-
Notifications
You must be signed in to change notification settings - Fork 466
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
Improve JSONDecodingError #581
Comments
Is this issue still open? and do you want help with it? |
Yes, still open. Adding associated values for the additional context is what would be useful. |
Okay, I’ll work on it during the weekend 😁 |
|
On client devices most JSON decoding errors will simply be "give up" types of cases. But some applications might want to log the error and report it back to a server via some metrics/usage channel.
In server uses, being able to get more details about bad inputs from clients will likely help debug the clients as well as for better server side logging to help detect DoS attacks vs. bad clients.
So…
Currently JSONDecodingError provides no real context of what went wrong. Some of them can easily include the sub part of the JSON that was bad (
.malformedDuration
,.malformedTimestamp
,.unrecognizedEnumValue
). In almost all cases, also including a line number/column number (or atleast offset into the blob) being parsed would likely help.The text was updated successfully, but these errors were encountered: