Skip to content

Fine-grained decoding errors

Compare
Choose a tag to compare
@kisielk kisielk released this 22 Mar 17:01
124d17e

Decoding errors now have types for more comprehensive error reporting:

  • UnknownKeyError is returned when an unknown key is encountered in the source map and the decoder is not set to ignore unknown keys.
  • EmptyFieldError is returned when a required field is empty.

Both error types have a Key attribute that can be inspected to determine the field that caused the error.