🔨 added user-defined exceptions 310
This commit is contained in:
parent
5cca44c161
commit
144cf6a4c7
3 changed files with 20 additions and 20 deletions
14
src/json.hpp
14
src/json.hpp
|
@ -5887,8 +5887,8 @@ class basic_json
|
||||||
|
|
||||||
@param[in,out] other array to exchange the contents with
|
@param[in,out] other array to exchange the contents with
|
||||||
|
|
||||||
@throw std::domain_error when JSON value is not an array; example:
|
@throw type_error.310 when JSON value is not an array; example: `"cannot
|
||||||
`"cannot use swap() with string"`
|
use swap() with string"`
|
||||||
|
|
||||||
@complexity Constant.
|
@complexity Constant.
|
||||||
|
|
||||||
|
@ -5906,7 +5906,7 @@ class basic_json
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
JSON_THROW(std::domain_error("cannot use swap() with " + type_name()));
|
JSON_THROW(type_error(310, "cannot use swap() with " + type_name()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5920,7 +5920,7 @@ class basic_json
|
||||||
|
|
||||||
@param[in,out] other object to exchange the contents with
|
@param[in,out] other object to exchange the contents with
|
||||||
|
|
||||||
@throw std::domain_error when JSON value is not an object; example:
|
@throw type_error.310 when JSON value is not an object; example:
|
||||||
`"cannot use swap() with string"`
|
`"cannot use swap() with string"`
|
||||||
|
|
||||||
@complexity Constant.
|
@complexity Constant.
|
||||||
|
@ -5939,7 +5939,7 @@ class basic_json
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
JSON_THROW(std::domain_error("cannot use swap() with " + type_name()));
|
JSON_THROW(type_error(310, "cannot use swap() with " + type_name()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5953,7 +5953,7 @@ class basic_json
|
||||||
|
|
||||||
@param[in,out] other string to exchange the contents with
|
@param[in,out] other string to exchange the contents with
|
||||||
|
|
||||||
@throw std::domain_error when JSON value is not a string; example: `"cannot
|
@throw type_error.310 when JSON value is not a string; example: `"cannot
|
||||||
use swap() with boolean"`
|
use swap() with boolean"`
|
||||||
|
|
||||||
@complexity Constant.
|
@complexity Constant.
|
||||||
|
@ -5972,7 +5972,7 @@ class basic_json
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
JSON_THROW(std::domain_error("cannot use swap() with " + type_name()));
|
JSON_THROW(type_error(310, "cannot use swap() with " + type_name()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5887,8 +5887,8 @@ class basic_json
|
||||||
|
|
||||||
@param[in,out] other array to exchange the contents with
|
@param[in,out] other array to exchange the contents with
|
||||||
|
|
||||||
@throw std::domain_error when JSON value is not an array; example:
|
@throw type_error.310 when JSON value is not an array; example: `"cannot
|
||||||
`"cannot use swap() with string"`
|
use swap() with string"`
|
||||||
|
|
||||||
@complexity Constant.
|
@complexity Constant.
|
||||||
|
|
||||||
|
@ -5906,7 +5906,7 @@ class basic_json
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
JSON_THROW(std::domain_error("cannot use swap() with " + type_name()));
|
JSON_THROW(type_error(310, "cannot use swap() with " + type_name()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5920,7 +5920,7 @@ class basic_json
|
||||||
|
|
||||||
@param[in,out] other object to exchange the contents with
|
@param[in,out] other object to exchange the contents with
|
||||||
|
|
||||||
@throw std::domain_error when JSON value is not an object; example:
|
@throw type_error.310 when JSON value is not an object; example:
|
||||||
`"cannot use swap() with string"`
|
`"cannot use swap() with string"`
|
||||||
|
|
||||||
@complexity Constant.
|
@complexity Constant.
|
||||||
|
@ -5939,7 +5939,7 @@ class basic_json
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
JSON_THROW(std::domain_error("cannot use swap() with " + type_name()));
|
JSON_THROW(type_error(310, "cannot use swap() with " + type_name()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5953,7 +5953,7 @@ class basic_json
|
||||||
|
|
||||||
@param[in,out] other string to exchange the contents with
|
@param[in,out] other string to exchange the contents with
|
||||||
|
|
||||||
@throw std::domain_error when JSON value is not a string; example: `"cannot
|
@throw type_error.310 when JSON value is not a string; example: `"cannot
|
||||||
use swap() with boolean"`
|
use swap() with boolean"`
|
||||||
|
|
||||||
@complexity Constant.
|
@complexity Constant.
|
||||||
|
@ -5972,7 +5972,7 @@ class basic_json
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
JSON_THROW(std::domain_error("cannot use swap() with " + type_name()));
|
JSON_THROW(type_error(310, "cannot use swap() with " + type_name()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -751,8 +751,8 @@ TEST_CASE("modifiers")
|
||||||
json j = 17;
|
json j = 17;
|
||||||
json::array_t a = {"foo", "bar", "baz"};
|
json::array_t a = {"foo", "bar", "baz"};
|
||||||
|
|
||||||
CHECK_THROWS_AS(j.swap(a), std::domain_error);
|
CHECK_THROWS_AS(j.swap(a), json::type_error);
|
||||||
CHECK_THROWS_WITH(j.swap(a), "cannot use swap() with number");
|
CHECK_THROWS_WITH(j.swap(a), "[json.exception.type_error.310] cannot use swap() with number");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -777,8 +777,8 @@ TEST_CASE("modifiers")
|
||||||
json j = 17;
|
json j = 17;
|
||||||
json::object_t o = {{"cow", "Kuh"}, {"chicken", "Huhn"}};
|
json::object_t o = {{"cow", "Kuh"}, {"chicken", "Huhn"}};
|
||||||
|
|
||||||
CHECK_THROWS_AS(j.swap(o), std::domain_error);
|
CHECK_THROWS_AS(j.swap(o), json::type_error);
|
||||||
CHECK_THROWS_WITH(j.swap(o), "cannot use swap() with number");
|
CHECK_THROWS_WITH(j.swap(o), "[json.exception.type_error.310] cannot use swap() with number");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -803,8 +803,8 @@ TEST_CASE("modifiers")
|
||||||
json j = 17;
|
json j = 17;
|
||||||
json::string_t s = "Hallo Welt";
|
json::string_t s = "Hallo Welt";
|
||||||
|
|
||||||
CHECK_THROWS_AS(j.swap(s), std::domain_error);
|
CHECK_THROWS_AS(j.swap(s), json::type_error);
|
||||||
CHECK_THROWS_WITH(j.swap(s), "cannot use swap() with number");
|
CHECK_THROWS_WITH(j.swap(s), "[json.exception.type_error.310] cannot use swap() with number");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue