1
0
mirror of https://github.com/nlohmann/json.git synced 2025-07-27 00:41: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

@ -63,10 +63,12 @@ TEST_CASE("element access 2")
SECTION("access outside bounds")
{
CHECK_THROWS_AS(j.at("foo"), std::out_of_range);
CHECK_THROWS_AS(j_const.at("foo"), std::out_of_range);
CHECK_THROWS_WITH(j.at("foo"), "key 'foo' not found");
CHECK_THROWS_WITH(j_const.at("foo"), "key 'foo' not found");
CHECK_THROWS_AS(j.at("foo"), json::out_of_range);
CHECK_THROWS_AS(j_const.at("foo"), json::out_of_range);
CHECK_THROWS_WITH(j.at("foo"),
"[json.exception.out_of_range.403] key 'foo' not found");
CHECK_THROWS_WITH(j_const.at("foo"),
"[json.exception.out_of_range.403] key 'foo' not found");
}
SECTION("access on non-object type")