-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Use diagnostic positions in exceptions #4561
Comments
@nlohmann I have been looking into this, I was wondering if Json_Diagnostic_Positions and Json_Diagnostics options are mutually exclusive, also please provide some hints for this task. |
No, the two options are not mutually exclusive:
So an example for the default behavior would be:
for
Now for
And if both options are set, we could have both:
|
Thanks for the clarification, I think I got it now, I will raise a PR shortly. |
We recently merged #4517 which added a macro
JSON_DIAGNOSTIC_POSITIONS
that, when defined, adds twostd::size_t
members to JSON values indicating the position of the first and last byte of this element in the input text. We should use this information to provide better diagnostic messages in exceptions.The text was updated successfully, but these errors were encountered: