You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Feature Request
It would be nice to get the path of the json file when an error occurs. Currently, only the type of the error is printed, with no way to know where in the json tree it happend, so it is very difficult to find the error.
For parse errors, I have implemented a way to show the place of the error:
And for type errors, I have tweaked the code for every JSON_THROW so that I get a dump of the value being parsed. But as I can not get the parent nor the name, only the value, I don't know where the error in the parse tree es:
JSON_THROW(type_error::create(302, "type must be string, but is " + std::string(j.type_name()) + j.dump() ));
The text was updated successfully, but these errors were encountered:
I understand your usecase, but I am hesitant into serializing whole JSON values into exceptions.
About the parse errors: you perfectly showed that such a feature is possible without a library change, and following the “not pay for what you don't use” principle, I don't think that we should add this to the library - especially printing to an output stream.
Feature Request
It would be nice to get the path of the json file when an error occurs. Currently, only the type of the error is printed, with no way to know where in the json tree it happend, so it is very difficult to find the error.
For parse errors, I have implemented a way to show the place of the error:
And for type errors, I have tweaked the code for every JSON_THROW so that I get a dump of the value being parsed. But as I can not get the parent nor the name, only the value, I don't know where the error in the parse tree es:
The text was updated successfully, but these errors were encountered: