easier way to get exception reason out of json_sax_dom_callback_parser without exceptions #2024
Labels
kind: enhancement/improvement
solution: proposed fix
a fix for the issue has been proposed and waits for confirmation
I am forced to disable exceptions in my project as I am targeting WASM with Emscripten.
I was able to use the code below to parse json from a
std::string
without using any exceptions. This works great for me however if I do hit a parse error, I would like to know what the error was. Looking atclass parser::parse()
it uses ajson_sax_dom_callback_parser
, which inturn callsparse_error()
. But there is no way to get the details of what happened from there whenallow_exceptions
isfalse
. Is it possible to add a callback somewhere that accepts aparse_error
or something like that?This is the function I'm using so far:
Thanks for the help, I really love this library but the internals are more complicated than I understand.
The text was updated successfully, but these errors were encountered: