error.go 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. package json
  2. import (
  3. "github.com/goccy/go-json/internal/errors"
  4. )
  5. // Before Go 1.2, an InvalidUTF8Error was returned by Marshal when
  6. // attempting to encode a string value with invalid UTF-8 sequences.
  7. // As of Go 1.2, Marshal instead coerces the string to valid UTF-8 by
  8. // replacing invalid bytes with the Unicode replacement rune U+FFFD.
  9. //
  10. // Deprecated: No longer used; kept for compatibility.
  11. type InvalidUTF8Error = errors.InvalidUTF8Error
  12. // An InvalidUnmarshalError describes an invalid argument passed to Unmarshal.
  13. // (The argument to Unmarshal must be a non-nil pointer.)
  14. type InvalidUnmarshalError = errors.InvalidUnmarshalError
  15. // A MarshalerError represents an error from calling a MarshalJSON or MarshalText method.
  16. type MarshalerError = errors.MarshalerError
  17. // A SyntaxError is a description of a JSON syntax error.
  18. type SyntaxError = errors.SyntaxError
  19. // An UnmarshalFieldError describes a JSON object key that
  20. // led to an unexported (and therefore unwritable) struct field.
  21. //
  22. // Deprecated: No longer used; kept for compatibility.
  23. type UnmarshalFieldError = errors.UnmarshalFieldError
  24. // An UnmarshalTypeError describes a JSON value that was
  25. // not appropriate for a value of a specific Go type.
  26. type UnmarshalTypeError = errors.UnmarshalTypeError
  27. // An UnsupportedTypeError is returned by Marshal when attempting
  28. // to encode an unsupported value type.
  29. type UnsupportedTypeError = errors.UnsupportedTypeError
  30. type UnsupportedValueError = errors.UnsupportedValueError