package gojay

import (
	
	
)

const invalidJSONCharErrorMsg = "Invalid JSON, wrong char '%c' found at position %d"

// InvalidJSONError is a type representing an error returned when
// Decoding encounters invalid JSON.
type InvalidJSONError string

func ( InvalidJSONError) () string {
	return string()
}

func ( *Decoder) ( int) error {
	var  byte
	if len(.data) >  {
		 = .data[]
	}
	.err = InvalidJSONError(
		fmt.Sprintf(
			invalidJSONCharErrorMsg,
			,
			,
		),
	)
	return .err
}

const invalidUnmarshalErrorMsg = "Cannot unmarshal JSON to type '%T'"

// InvalidUnmarshalError is a type representing an error returned when
// Decoding cannot unmarshal JSON to the receiver type for various reasons.
type InvalidUnmarshalError string

func ( InvalidUnmarshalError) () string {
	return string()
}

func ( *Decoder) ( interface{}) error {
	return InvalidUnmarshalError(
		fmt.Sprintf(
			invalidUnmarshalErrorMsg,
			,
		),
	)
}

const invalidMarshalErrorMsg = "Invalid type %T provided to Marshal"

// InvalidMarshalError is a type representing an error returned when
// Encoding did not find the proper way to encode
type InvalidMarshalError string

func ( InvalidMarshalError) () string {
	return string()
}

// NoReaderError is a type representing an error returned when
// decoding requires a reader and none was given
type NoReaderError string

func ( NoReaderError) () string {
	return string()
}

// InvalidUsagePooledDecoderError is a type representing an error returned
// when decoding is called on a still pooled Decoder
type InvalidUsagePooledDecoderError string

func ( InvalidUsagePooledDecoderError) () string {
	return string()
}

// InvalidUsagePooledEncoderError is a type representing an error returned
// when decoding is called on a still pooled Encoder
type InvalidUsagePooledEncoderError string

func ( InvalidUsagePooledEncoderError) () string {
	return string()
}

// ErrUnmarshalPtrExpected is the error returned when unmarshal expects a pointer value,
// When using `dec.ObjectNull` or `dec.ArrayNull` for example.
var ErrUnmarshalPtrExpected = errors.New("Cannot unmarshal to given value, a pointer is expected")