Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

sandwwraith
Copy link
Member

Such a code path is often used when we cannot find a type discriminator as a first key in Json (for example, if json input is invalid, and we get a string instead of an object). In such cases, we should display a nice error message.

Also, add a tag stack — the equivalent of a Json path — to most of the error messages. Note that it is far from ideal since changing between string and tree decoders (such happens in polymorphism) won't preserve stack or path correctly. Yet, it is the best we can do for now.

Fixes #2630

…ent.

Such a code path is often used when we cannot find type discriminator as a first key in Json (for example, if json input is invalid, and we got a string instead of an object). In such cases, we should display a nice error message.

Also add tag stack — equivalent of a Json path — to most of the error messages. Note that it is far from an ideal, since changing between string and tree decoders (such happens in polymorphism) won't preserve stack or path correctly. Yet, it is the best we can do for now.

Fixes #2630
@sandwwraith sandwwraith requested a review from shanshin April 22, 2024 17:20
@sandwwraith sandwwraith self-assigned this Apr 24, 2024
@sandwwraith sandwwraith merged commit e35c28d into dev May 14, 2024
@sandwwraith sandwwraith deleted the better-json-exceptions branch May 14, 2024 12:07
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.

2 participants