Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
json
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
json
Commits
f473f74f
Unverified
Commit
f473f74f
authored
Mar 05, 2017
by
Niels Lohmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🔨
added user-defined exceptions 303-304
parent
068c7acd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
84 additions
and
86 deletions
+84
-86
src/json.hpp
src/json.hpp
+14
-15
src/json.hpp.re2c
src/json.hpp.re2c
+14
-15
test/src/unit-element_access1.cpp
test/src/unit-element_access1.cpp
+28
-28
test/src/unit-element_access2.cpp
test/src/unit-element_access2.cpp
+28
-28
No files found.
src/json.hpp
View file @
f473f74f
...
...
@@ -3255,7 +3255,7 @@ class basic_json
@tparam ThisType will be deduced as `basic_json` or `const basic_json`
@throw
std::domain_error
if ReferenceType does not match underlying value
@throw
type_error.303
if ReferenceType does not match underlying value
type of the current JSON
*/
template
<
typename
ReferenceType
,
typename
ThisType
>
...
...
@@ -3272,8 +3272,7 @@ class basic_json
return
*
ptr
;
}
JSON_THROW
(
std
::
domain_error
(
"incompatible ReferenceType for get_ref, actual type is "
+
obj
.
type_name
()));
JSON_THROW
(
type_error
(
303
,
"incompatible ReferenceType for get_ref, actual type is "
+
obj
.
type_name
()));
}
public:
...
...
@@ -3554,8 +3553,8 @@ class basic_json
reference type @a ReferenceType fits to the JSON value; throws
std::domain_error otherwise
@throw
std::domain_error in case passed type @a ReferenceType is
incompatible
with the stored JSON value
@throw
type_error.303 in case passed type @a ReferenceType is incompatible
with the stored JSON value
@complexity Constant.
...
...
@@ -3646,8 +3645,8 @@ class basic_json
@return reference to the element at index @a idx
@throw
std::domain_error if the JSON value is not an array; example:
`"cannot
use at() with string"`
@throw
type_error.304 if the JSON value is not an array; example: `"cannot
use at() with string"`
@throw std::out_of_range if the index @a idx is out of range of the array;
that is, `idx >= size()`; example: `"array index 7 is out of range"`
...
...
@@ -3675,7 +3674,7 @@ class basic_json
}
else
{
JSON_THROW
(
std
::
domain_error
(
"cannot use at() with "
+
type_name
()));
JSON_THROW
(
type_error
(
304
,
"cannot use at() with "
+
type_name
()));
}
}
...
...
@@ -3689,8 +3688,8 @@ class basic_json
@return const reference to the element at index @a idx
@throw
std::domain_error if the JSON value is not an array; example:
`"cannot
use at() with string"`
@throw
type_error.304 if the JSON value is not an array; example: `"cannot
use at() with string"`
@throw std::out_of_range if the index @a idx is out of range of the array;
that is, `idx >= size()`; example: `"array index 7 is out of range"`
...
...
@@ -3718,7 +3717,7 @@ class basic_json
}
else
{
JSON_THROW
(
std
::
domain_error
(
"cannot use at() with "
+
type_name
()));
JSON_THROW
(
type_error
(
304
,
"cannot use at() with "
+
type_name
()));
}
}
...
...
@@ -3732,7 +3731,7 @@ class basic_json
@return reference to the element at key @a key
@throw
std::domain_error
if the JSON value is not an object; example:
@throw
type_error.304
if the JSON value is not an object; example:
`"cannot use at() with boolean"`
@throw std::out_of_range if the key @a key is is not stored in the object;
that is, `find(key) == end()`; example: `"key "the fast" not found"`
...
...
@@ -3765,7 +3764,7 @@ class basic_json
}
else
{
JSON_THROW
(
std
::
domain_error
(
"cannot use at() with "
+
type_name
()));
JSON_THROW
(
type_error
(
304
,
"cannot use at() with "
+
type_name
()));
}
}
...
...
@@ -3779,7 +3778,7 @@ class basic_json
@return const reference to the element at key @a key
@throw
std::domain_error
if the JSON value is not an object; example:
@throw
type_error.304
if the JSON value is not an object; example:
`"cannot use at() with boolean"`
@throw std::out_of_range if the key @a key is is not stored in the object;
that is, `find(key) == end()`; example: `"key "the fast" not found"`
...
...
@@ -3812,7 +3811,7 @@ class basic_json
}
else
{
JSON_THROW
(
std
::
domain_error
(
"cannot use at() with "
+
type_name
()));
JSON_THROW
(
type_error
(
304
,
"cannot use at() with "
+
type_name
()));
}
}
...
...
src/json.hpp.re2c
View file @
f473f74f
...
...
@@ -3255,7 +3255,7 @@ class basic_json
@tparam ThisType will be deduced as `basic_json` or `const basic_json`
@throw
std::domain_error
if ReferenceType does not match underlying value
@throw
type_error.303
if ReferenceType does not match underlying value
type of the current JSON
*/
template<typename ReferenceType, typename ThisType>
...
...
@@ -3272,8 +3272,7 @@ class basic_json
return *ptr;
}
JSON_THROW(std::domain_error("incompatible ReferenceType for get_ref, actual type is " +
obj.type_name()));
JSON_THROW(type_error(303, "incompatible ReferenceType for get_ref, actual type is " + obj.type_name()));
}
public:
...
...
@@ -3554,8 +3553,8 @@ class basic_json
reference type @a ReferenceType fits to the JSON value; throws
std::domain_error otherwise
@throw
std::domain_error in case passed type @a ReferenceType is
incompatible
with the stored JSON value
@throw
type_error.303 in case passed type @a ReferenceType is incompatible
with the stored JSON value
@complexity Constant.
...
...
@@ -3646,8 +3645,8 @@ class basic_json
@return reference to the element at index @a idx
@throw
std::domain_error if the JSON value is not an array; example:
`"cannot
use at() with string"`
@throw
type_error.304 if the JSON value is not an array; example: `"cannot
use at() with string"`
@throw std::out_of_range if the index @a idx is out of range of the array;
that is, `idx >= size()`; example: `"array index 7 is out of range"`
...
...
@@ -3675,7 +3674,7 @@ class basic_json
}
else
{
JSON_THROW(
std::domain_error(
"cannot use at() with " + type_name()));
JSON_THROW(
type_error(304,
"cannot use at() with " + type_name()));
}
}
...
...
@@ -3689,8 +3688,8 @@ class basic_json
@return const reference to the element at index @a idx
@throw
std::domain_error if the JSON value is not an array; example:
`"cannot
use at() with string"`
@throw
type_error.304 if the JSON value is not an array; example: `"cannot
use at() with string"`
@throw std::out_of_range if the index @a idx is out of range of the array;
that is, `idx >= size()`; example: `"array index 7 is out of range"`
...
...
@@ -3718,7 +3717,7 @@ class basic_json
}
else
{
JSON_THROW(
std::domain_error(
"cannot use at() with " + type_name()));
JSON_THROW(
type_error(304,
"cannot use at() with " + type_name()));
}
}
...
...
@@ -3732,7 +3731,7 @@ class basic_json
@return reference to the element at key @a key
@throw
std::domain_error
if the JSON value is not an object; example:
@throw
type_error.304
if the JSON value is not an object; example:
`"cannot use at() with boolean"`
@throw std::out_of_range if the key @a key is is not stored in the object;
that is, `find(key) == end()`; example: `"key "the fast" not found"`
...
...
@@ -3765,7 +3764,7 @@ class basic_json
}
else
{
JSON_THROW(
std::domain_error(
"cannot use at() with " + type_name()));
JSON_THROW(
type_error(304,
"cannot use at() with " + type_name()));
}
}
...
...
@@ -3779,7 +3778,7 @@ class basic_json
@return const reference to the element at key @a key
@throw
std::domain_error
if the JSON value is not an object; example:
@throw
type_error.304
if the JSON value is not an object; example:
`"cannot use at() with boolean"`
@throw std::out_of_range if the key @a key is is not stored in the object;
that is, `find(key) == end()`; example: `"key "the fast" not found"`
...
...
@@ -3812,7 +3811,7 @@ class basic_json
}
else
{
JSON_THROW(
std::domain_error(
"cannot use at() with " + type_name()));
JSON_THROW(
type_error(304,
"cannot use at() with " + type_name()));
}
}
...
...
test/src/unit-element_access1.cpp
View file @
f473f74f
...
...
@@ -76,77 +76,77 @@ TEST_CASE("element access 1")
{
json
j_nonarray
(
json
::
value_t
::
null
);
const
json
j_nonarray_const
(
j_nonarray
);
CHECK_THROWS_AS
(
j_nonarray
.
at
(
0
),
std
::
domain
_error
);
CHECK_THROWS_AS
(
j_nonarray_const
.
at
(
0
),
std
::
domain
_error
);
CHECK_THROWS_AS
(
j_nonarray
.
at
(
0
),
json
::
type
_error
);
CHECK_THROWS_AS
(
j_nonarray_const
.
at
(
0
),
json
::
type
_error
);
CHECK_THROWS_WITH
(
j_nonarray
.
at
(
0
),
"cannot use at() with null"
);
CHECK_THROWS_WITH
(
j_nonarray_const
.
at
(
0
),
"cannot use at() with null"
);
CHECK_THROWS_WITH
(
j_nonarray
.
at
(
0
),
"
[json.exception.type_error.304]
cannot use at() with null"
);
CHECK_THROWS_WITH
(
j_nonarray_const
.
at
(
0
),
"
[json.exception.type_error.304]
cannot use at() with null"
);
}
SECTION
(
"boolean"
)
{
json
j_nonarray
(
json
::
value_t
::
boolean
);
const
json
j_nonarray_const
(
j_nonarray
);
CHECK_THROWS_AS
(
j_nonarray
.
at
(
0
),
std
::
domain
_error
);
CHECK_THROWS_AS
(
j_nonarray_const
.
at
(
0
),
std
::
domain
_error
);
CHECK_THROWS_AS
(
j_nonarray
.
at
(
0
),
json
::
type
_error
);
CHECK_THROWS_AS
(
j_nonarray_const
.
at
(
0
),
json
::
type
_error
);
CHECK_THROWS_WITH
(
j_nonarray
.
at
(
0
),
"cannot use at() with boolean"
);
CHECK_THROWS_WITH
(
j_nonarray_const
.
at
(
0
),
"cannot use at() with boolean"
);
CHECK_THROWS_WITH
(
j_nonarray
.
at
(
0
),
"
[json.exception.type_error.304]
cannot use at() with boolean"
);
CHECK_THROWS_WITH
(
j_nonarray_const
.
at
(
0
),
"
[json.exception.type_error.304]
cannot use at() with boolean"
);
}
SECTION
(
"string"
)
{
json
j_nonarray
(
json
::
value_t
::
string
);
const
json
j_nonarray_const
(
j_nonarray
);
CHECK_THROWS_AS
(
j_nonarray
.
at
(
0
),
std
::
domain
_error
);
CHECK_THROWS_AS
(
j_nonarray_const
.
at
(
0
),
std
::
domain
_error
);
CHECK_THROWS_AS
(
j_nonarray
.
at
(
0
),
json
::
type
_error
);
CHECK_THROWS_AS
(
j_nonarray_const
.
at
(
0
),
json
::
type
_error
);
CHECK_THROWS_WITH
(
j_nonarray
.
at
(
0
),
"cannot use at() with string"
);
CHECK_THROWS_WITH
(
j_nonarray_const
.
at
(
0
),
"cannot use at() with string"
);
CHECK_THROWS_WITH
(
j_nonarray
.
at
(
0
),
"
[json.exception.type_error.304]
cannot use at() with string"
);
CHECK_THROWS_WITH
(
j_nonarray_const
.
at
(
0
),
"
[json.exception.type_error.304]
cannot use at() with string"
);
}
SECTION
(
"object"
)
{
json
j_nonarray
(
json
::
value_t
::
object
);
const
json
j_nonarray_const
(
j_nonarray
);
CHECK_THROWS_AS
(
j_nonarray
.
at
(
0
),
std
::
domain
_error
);
CHECK_THROWS_AS
(
j_nonarray_const
.
at
(
0
),
std
::
domain
_error
);
CHECK_THROWS_AS
(
j_nonarray
.
at
(
0
),
json
::
type
_error
);
CHECK_THROWS_AS
(
j_nonarray_const
.
at
(
0
),
json
::
type
_error
);
CHECK_THROWS_WITH
(
j_nonarray
.
at
(
0
),
"cannot use at() with object"
);
CHECK_THROWS_WITH
(
j_nonarray_const
.
at
(
0
),
"cannot use at() with object"
);
CHECK_THROWS_WITH
(
j_nonarray
.
at
(
0
),
"
[json.exception.type_error.304]
cannot use at() with object"
);
CHECK_THROWS_WITH
(
j_nonarray_const
.
at
(
0
),
"
[json.exception.type_error.304]
cannot use at() with object"
);
}
SECTION
(
"number (integer)"
)
{
json
j_nonarray
(
json
::
value_t
::
number_integer
);
const
json
j_nonarray_const
(
j_nonarray
);
CHECK_THROWS_AS
(
j_nonarray
.
at
(
0
),
std
::
domain
_error
);
CHECK_THROWS_AS
(
j_nonarray_const
.
at
(
0
),
std
::
domain
_error
);
CHECK_THROWS_AS
(
j_nonarray
.
at
(
0
),
json
::
type
_error
);
CHECK_THROWS_AS
(
j_nonarray_const
.
at
(
0
),
json
::
type
_error
);
CHECK_THROWS_WITH
(
j_nonarray
.
at
(
0
),
"cannot use at() with number"
);
CHECK_THROWS_WITH
(
j_nonarray_const
.
at
(
0
),
"cannot use at() with number"
);
CHECK_THROWS_WITH
(
j_nonarray
.
at
(
0
),
"
[json.exception.type_error.304]
cannot use at() with number"
);
CHECK_THROWS_WITH
(
j_nonarray_const
.
at
(
0
),
"
[json.exception.type_error.304]
cannot use at() with number"
);
}
SECTION
(
"number (unsigned)"
)
{
json
j_nonarray
(
json
::
value_t
::
number_unsigned
);
const
json
j_nonarray_const
(
j_nonarray
);
CHECK_THROWS_AS
(
j_nonarray
.
at
(
0
),
std
::
domain
_error
);
CHECK_THROWS_AS
(
j_nonarray_const
.
at
(
0
),
std
::
domain
_error
);
CHECK_THROWS_AS
(
j_nonarray
.
at
(
0
),
json
::
type
_error
);
CHECK_THROWS_AS
(
j_nonarray_const
.
at
(
0
),
json
::
type
_error
);
CHECK_THROWS_WITH
(
j_nonarray
.
at
(
0
),
"cannot use at() with number"
);
CHECK_THROWS_WITH
(
j_nonarray_const
.
at
(
0
),
"cannot use at() with number"
);
CHECK_THROWS_WITH
(
j_nonarray
.
at
(
0
),
"
[json.exception.type_error.304]
cannot use at() with number"
);
CHECK_THROWS_WITH
(
j_nonarray_const
.
at
(
0
),
"
[json.exception.type_error.304]
cannot use at() with number"
);
}
SECTION
(
"number (floating-point)"
)
{
json
j_nonarray
(
json
::
value_t
::
number_float
);
const
json
j_nonarray_const
(
j_nonarray
);
CHECK_THROWS_AS
(
j_nonarray
.
at
(
0
),
std
::
domain
_error
);
CHECK_THROWS_AS
(
j_nonarray_const
.
at
(
0
),
std
::
domain
_error
);
CHECK_THROWS_AS
(
j_nonarray
.
at
(
0
),
json
::
type
_error
);
CHECK_THROWS_AS
(
j_nonarray_const
.
at
(
0
),
json
::
type
_error
);
CHECK_THROWS_WITH
(
j_nonarray
.
at
(
0
),
"cannot use at() with number"
);
CHECK_THROWS_WITH
(
j_nonarray_const
.
at
(
0
),
"cannot use at() with number"
);
CHECK_THROWS_WITH
(
j_nonarray
.
at
(
0
),
"
[json.exception.type_error.304]
cannot use at() with number"
);
CHECK_THROWS_WITH
(
j_nonarray_const
.
at
(
0
),
"
[json.exception.type_error.304]
cannot use at() with number"
);
}
}
}
...
...
test/src/unit-element_access2.cpp
View file @
f473f74f
...
...
@@ -75,70 +75,70 @@ TEST_CASE("element access 2")
{
json
j_nonobject
(
json
::
value_t
::
null
);
const
json
j_nonobject_const
(
j_nonobject
);
CHECK_THROWS_AS
(
j_nonobject
.
at
(
"foo"
),
std
::
domain
_error
);
CHECK_THROWS_AS
(
j_nonobject_const
.
at
(
"foo"
),
std
::
domain
_error
);
CHECK_THROWS_WITH
(
j_nonobject
.
at
(
"foo"
),
"cannot use at() with null"
);
CHECK_THROWS_WITH
(
j_nonobject_const
.
at
(
"foo"
),
"cannot use at() with null"
);
CHECK_THROWS_AS
(
j_nonobject
.
at
(
"foo"
),
json
::
type
_error
);
CHECK_THROWS_AS
(
j_nonobject_const
.
at
(
"foo"
),
json
::
type
_error
);
CHECK_THROWS_WITH
(
j_nonobject
.
at
(
"foo"
),
"
[json.exception.type_error.304]
cannot use at() with null"
);
CHECK_THROWS_WITH
(
j_nonobject_const
.
at
(
"foo"
),
"
[json.exception.type_error.304]
cannot use at() with null"
);
}
SECTION
(
"boolean"
)
{
json
j_nonobject
(
json
::
value_t
::
boolean
);
const
json
j_nonobject_const
(
j_nonobject
);
CHECK_THROWS_AS
(
j_nonobject
.
at
(
"foo"
),
std
::
domain
_error
);
CHECK_THROWS_AS
(
j_nonobject_const
.
at
(
"foo"
),
std
::
domain
_error
);
CHECK_THROWS_WITH
(
j_nonobject
.
at
(
"foo"
),
"cannot use at() with boolean"
);
CHECK_THROWS_WITH
(
j_nonobject_const
.
at
(
"foo"
),
"cannot use at() with boolean"
);
CHECK_THROWS_AS
(
j_nonobject
.
at
(
"foo"
),
json
::
type
_error
);
CHECK_THROWS_AS
(
j_nonobject_const
.
at
(
"foo"
),
json
::
type
_error
);
CHECK_THROWS_WITH
(
j_nonobject
.
at
(
"foo"
),
"
[json.exception.type_error.304]
cannot use at() with boolean"
);
CHECK_THROWS_WITH
(
j_nonobject_const
.
at
(
"foo"
),
"
[json.exception.type_error.304]
cannot use at() with boolean"
);
}
SECTION
(
"string"
)
{
json
j_nonobject
(
json
::
value_t
::
string
);
const
json
j_nonobject_const
(
j_nonobject
);
CHECK_THROWS_AS
(
j_nonobject
.
at
(
"foo"
),
std
::
domain
_error
);
CHECK_THROWS_AS
(
j_nonobject_const
.
at
(
"foo"
),
std
::
domain
_error
);
CHECK_THROWS_WITH
(
j_nonobject
.
at
(
"foo"
),
"cannot use at() with string"
);
CHECK_THROWS_WITH
(
j_nonobject_const
.
at
(
"foo"
),
"cannot use at() with string"
);
CHECK_THROWS_AS
(
j_nonobject
.
at
(
"foo"
),
json
::
type
_error
);
CHECK_THROWS_AS
(
j_nonobject_const
.
at
(
"foo"
),
json
::
type
_error
);
CHECK_THROWS_WITH
(
j_nonobject
.
at
(
"foo"
),
"
[json.exception.type_error.304]
cannot use at() with string"
);
CHECK_THROWS_WITH
(
j_nonobject_const
.
at
(
"foo"
),
"
[json.exception.type_error.304]
cannot use at() with string"
);
}
SECTION
(
"array"
)
{
json
j_nonobject
(
json
::
value_t
::
array
);
const
json
j_nonobject_const
(
j_nonobject
);
CHECK_THROWS_AS
(
j_nonobject
.
at
(
"foo"
),
std
::
domain
_error
);
CHECK_THROWS_AS
(
j_nonobject_const
.
at
(
"foo"
),
std
::
domain
_error
);
CHECK_THROWS_WITH
(
j_nonobject
.
at
(
"foo"
),
"cannot use at() with array"
);
CHECK_THROWS_WITH
(
j_nonobject_const
.
at
(
"foo"
),
"cannot use at() with array"
);
CHECK_THROWS_AS
(
j_nonobject
.
at
(
"foo"
),
json
::
type
_error
);
CHECK_THROWS_AS
(
j_nonobject_const
.
at
(
"foo"
),
json
::
type
_error
);
CHECK_THROWS_WITH
(
j_nonobject
.
at
(
"foo"
),
"
[json.exception.type_error.304]
cannot use at() with array"
);
CHECK_THROWS_WITH
(
j_nonobject_const
.
at
(
"foo"
),
"
[json.exception.type_error.304]
cannot use at() with array"
);
}
SECTION
(
"number (integer)"
)
{
json
j_nonobject
(
json
::
value_t
::
number_integer
);
const
json
j_nonobject_const
(
j_nonobject
);
CHECK_THROWS_AS
(
j_nonobject
.
at
(
"foo"
),
std
::
domain
_error
);
CHECK_THROWS_AS
(
j_nonobject_const
.
at
(
"foo"
),
std
::
domain
_error
);
CHECK_THROWS_WITH
(
j_nonobject
.
at
(
"foo"
),
"cannot use at() with number"
);
CHECK_THROWS_WITH
(
j_nonobject_const
.
at
(
"foo"
),
"cannot use at() with number"
);
CHECK_THROWS_AS
(
j_nonobject
.
at
(
"foo"
),
json
::
type
_error
);
CHECK_THROWS_AS
(
j_nonobject_const
.
at
(
"foo"
),
json
::
type
_error
);
CHECK_THROWS_WITH
(
j_nonobject
.
at
(
"foo"
),
"
[json.exception.type_error.304]
cannot use at() with number"
);
CHECK_THROWS_WITH
(
j_nonobject_const
.
at
(
"foo"
),
"
[json.exception.type_error.304]
cannot use at() with number"
);
}
SECTION
(
"number (unsigned)"
)
{
json
j_nonobject
(
json
::
value_t
::
number_unsigned
);
const
json
j_nonobject_const
(
j_nonobject
);
CHECK_THROWS_AS
(
j_nonobject
.
at
(
"foo"
),
std
::
domain
_error
);
CHECK_THROWS_AS
(
j_nonobject_const
.
at
(
"foo"
),
std
::
domain
_error
);
CHECK_THROWS_WITH
(
j_nonobject
.
at
(
"foo"
),
"cannot use at() with number"
);
CHECK_THROWS_WITH
(
j_nonobject_const
.
at
(
"foo"
),
"cannot use at() with number"
);
CHECK_THROWS_AS
(
j_nonobject
.
at
(
"foo"
),
json
::
type
_error
);
CHECK_THROWS_AS
(
j_nonobject_const
.
at
(
"foo"
),
json
::
type
_error
);
CHECK_THROWS_WITH
(
j_nonobject
.
at
(
"foo"
),
"
[json.exception.type_error.304]
cannot use at() with number"
);
CHECK_THROWS_WITH
(
j_nonobject_const
.
at
(
"foo"
),
"
[json.exception.type_error.304]
cannot use at() with number"
);
}
SECTION
(
"number (floating-point)"
)
{
json
j_nonobject
(
json
::
value_t
::
number_float
);
const
json
j_nonobject_const
(
j_nonobject
);
CHECK_THROWS_AS
(
j_nonobject
.
at
(
"foo"
),
std
::
domain
_error
);
CHECK_THROWS_AS
(
j_nonobject_const
.
at
(
"foo"
),
std
::
domain
_error
);
CHECK_THROWS_WITH
(
j_nonobject
.
at
(
"foo"
),
"cannot use at() with number"
);
CHECK_THROWS_WITH
(
j_nonobject_const
.
at
(
"foo"
),
"cannot use at() with number"
);
CHECK_THROWS_AS
(
j_nonobject
.
at
(
"foo"
),
json
::
type
_error
);
CHECK_THROWS_AS
(
j_nonobject_const
.
at
(
"foo"
),
json
::
type
_error
);
CHECK_THROWS_WITH
(
j_nonobject
.
at
(
"foo"
),
"
[json.exception.type_error.304]
cannot use at() with number"
);
CHECK_THROWS_WITH
(
j_nonobject_const
.
at
(
"foo"
),
"
[json.exception.type_error.304]
cannot use at() with number"
);
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment