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

Change exception message used when MissingMemberHandling.Error is active #2997

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

KarlOfDuty
Copy link

@KarlOfDuty KarlOfDuty commented Nov 2, 2024

Changes the exception message Could not find member '{0}' on object of type '{1}' to The JSON property '{0}' does not exist on object of type '{1}'

The existing message is not very clear about if the problem is a missing property in the JSON string or if it is missing in the .NET object.

The new message is more clear that a JSON property exists and it does not correspond to a member on the .NET object.

While this is not too difficult to figure out for a developer well versed in the library, in my use case I show these messages to administrators who are likely thinking that "Could not find" means they have to add that thing to the json string they entered.

Also, my editor removed some trailing spaces as you can see in the diffs. Let me know if you want me to undo those whitespace changes.

The existing message "Could not find member '{0}' on object of type '{1}'" is not very clear if the problem is a missing property in the JSON string or if it is missing in the .NET object.

The new message "The JSON property '{0}' does not exist on object of type '{1}'" is more clear that there IS a JSON property but there is no corresponding member on the .NET object.
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.

1 participant