mirror of
https://github.com/nlohmann/json.git
synced 2026-04-28 18:59:25 +00:00
Add new JSON_INTERNAL_CATCH macro function
This commit is contained in:
@@ -3437,7 +3437,7 @@ class basic_json
|
||||
{
|
||||
return ptr.get_checked(this);
|
||||
}
|
||||
JSON_CATCH (out_of_range&)
|
||||
JSON_INTERNAL_CATCH (out_of_range&)
|
||||
{
|
||||
return default_value;
|
||||
}
|
||||
@@ -7359,7 +7359,7 @@ class basic_json
|
||||
// the "path" location must exist - use at()
|
||||
success = (result.at(ptr) == get_value("test", "value", false));
|
||||
}
|
||||
JSON_CATCH (out_of_range&)
|
||||
JSON_INTERNAL_CATCH (out_of_range&)
|
||||
{
|
||||
// ignore out of range errors: success remains false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user