1
0
mirror of https://github.com/nlohmann/json.git synced 2025-07-28 12:02:00 +03:00

Merge pull request #1187 from devsisters/json-internal-catch

[RFC] Introduce a new macro function: JSON_INTERNAL_CATCH
This commit is contained in:
Niels Lohmann
2018-08-14 21:56:29 +02:00
committed by GitHub
4 changed files with 20 additions and 4 deletions

View File

@ -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
}