1
0
mirror of https://github.com/nlohmann/json.git synced 2025-07-21 04:22:05 +03:00

🔨 added user-defined exception 403

This commit is contained in:
Niels Lohmann
2017-03-05 23:16:17 +01:00
parent 60da36aee2
commit 30331fa21f
5 changed files with 51 additions and 42 deletions

View File

@ -185,8 +185,9 @@ TEST_CASE("JSON pointers")
CHECK(j[json::json_pointer("/m~0n")] == j["m~n"]);
// unescaped access
CHECK_THROWS_AS(j.at(json::json_pointer("/a/b")), std::out_of_range);
CHECK_THROWS_WITH(j.at(json::json_pointer("/a/b")), "key 'a' not found");
CHECK_THROWS_AS(j.at(json::json_pointer("/a/b")), json::out_of_range);
CHECK_THROWS_WITH(j.at(json::json_pointer("/a/b")),
"[json.exception.out_of_range.403] key 'a' not found");
// unresolved access
const json j_primitive = 1;