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
I was struggling a bit getting reasonable error codes. I use the exception-based API for readability purposes. Most of these functions take a source_location parameter but it turns out that the location information is lost when the exception is thrown. For example a call to at() on a json::object will drop the information and instead have the call site of the internal function:
Welp, I'm wrong here. There's two source_location objects being stored, one in the ec and one in the location_ over in throw_location. I thought the macro in try_at conditionally threw if exceptions were enabled but I was obviously wrong. In order to get the correct throw location, seems a call to get_throw_location has to be made. I guess I learned a bit more about boost exceptions today. Sorry fro the clutter.
No problem. I should really document how to get the corresponding source_locations. The fact that you were confused by them highlights it. I'm reopening the issue and repurposing it for tracking documentation for dealing with source_locations.
I was struggling a bit getting reasonable error codes. I use the exception-based API for readability purposes. Most of these functions take a source_location parameter but it turns out that the location information is lost when the exception is thrown. For example a call to
at()
on ajson::object
will drop the information and instead have the call site of the internal function:try_at
gets called and throws soloc
being set in the result type doesn't matter.Is there a decent way to avoid this short of wrapping everything?
The text was updated successfully, but these errors were encountered: