Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added in a more user-friendly error message for when a field is missi… #503

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

genixpro
Copy link

@genixpro genixpro commented Nov 26, 2023

Previously this code was just crashing if I attempted to decode JSON with a field missing. Now it will crash with an error message that indicates more precisely what is actually happening.

…ng, rather than just allowing the default exception which is hard to interpret.
@george-zubrienko
Copy link
Collaborator

@genixpro looks like this breaks the test suite:

raise TypeError(
f"The JSON data is missing the required field '{field.name}' when decoding {cls.name} from JSON."
)

Maybe you can have a look why?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants