On Mon, Apr 25, 2022 at 1:55 PM Kenneth Porter via Boost
wrote:
I don't see any information on where in the source string the
parse error happened so I have to set a breakpoint in my tag_invoke
functions to figure out where the syntax errors lie.
You have two potentially throwing lines:
boost::json::value jv = boost::json::parse(contents);
and
axes = boost::json::value_to(), things are
not so simple. The original JSON string is no longer available, and
information about which json::value came from what part of the string
is not stored (that would slow down the library and take up
unnecessary memory). The best you can do in this case is to set up
BOOST_THROW_EXCEPTION to get a breakpoint at the moment an exception
is thrown, and then use a debugger to inspect the state of the
program. You can also attach source file and line number information
to exceptions when they are thrown (the library already does this).
Boost.JSON throws all exceptions from these functions; alternatively,
you could set a breakpoint in each of them to inspect the state of the
program when an error is encountered:
https://github.com/boostorg/json/blob/83c364afaf31b58cfe8b97ab159c406c508f47...
Thanks