You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -63,7 +63,7 @@ Exceptions in the library are thrown in the local context of the JSON value they
63
63
```cpp
64
64
--8<-- "examples/diagnostics_standard.cpp"
65
65
```
66
-
66
+
67
67
Output:
68
68
69
69
```
@@ -81,7 +81,7 @@ As this global context comes at the price of storing one additional pointer per
81
81
```cpp
82
82
--8<-- "examples/diagnostics_extended.cpp"
83
83
```
84
-
84
+
85
85
Output:
86
86
87
87
```
@@ -116,7 +116,7 @@ Exceptions have ids 1xx.
116
116
```cpp
117
117
--8<-- "examples/parse_error.cpp"
118
118
```
119
-
119
+
120
120
Output:
121
121
122
122
```
@@ -139,7 +139,7 @@ This error indicates a syntax error while deserializing a JSON text. The error m
139
139
No input:
140
140
141
141
```
142
-
[json.exception.parse_error.101] parse error at line 1, column 1: syntax error while parsing value - unexpected end of input; expected '[', '{', or a literal
142
+
[json.exception.parse_error.101] parse error at line 1, column 1: attempting to parse an empty input; check that your input string or stream contains the expected JSON
143
143
```
144
144
145
145
Control character was not escaped:
@@ -368,7 +368,7 @@ Exceptions have ids 2xx.
368
368
```cpp
369
369
--8<-- "examples/invalid_iterator.cpp"
370
370
```
371
-
371
+
372
372
Output:
373
373
374
374
```
@@ -532,7 +532,7 @@ Exceptions have ids 3xx.
532
532
```cpp
533
533
--8<-- "examples/type_error.cpp"
534
534
```
535
-
535
+
536
536
Output:
537
537
538
538
```
@@ -726,7 +726,7 @@ The `dump()` function only works with UTF-8 encoded strings; that is, if you ass
726
726
727
727
- Store the source file with UTF-8 encoding.
728
728
- Pass an error handler as last parameter to the `dump()` function to avoid this exception:
729
-
- `json::error_handler_t::replace` will replace invalid bytes sequences with `U+FFFD`
729
+
- `json::error_handler_t::replace` will replace invalid bytes sequences with `U+FFFD`
730
730
- `json::error_handler_t::ignore` will silently ignore invalid byte sequences
731
731
732
732
### json.exception.type_error.317
@@ -761,7 +761,7 @@ Exceptions have ids 4xx.
761
761
```cpp
762
762
--8<-- "examples/out_of_range.cpp"
763
763
```
764
-
764
+
765
765
Output:
766
766
767
767
```
@@ -840,7 +840,7 @@ UBJSON and BSON only support integer numbers up to 9223372036854775807.
840
840
841
841
!!! note
842
842
843
-
Since version 3.9.0, integer numbers beyond int64 are serialized as high-precision UBJSON numbers, and this exception does not further occur.
843
+
Since version 3.9.0, integer numbers beyond int64 are serialized as high-precision UBJSON numbers, and this exception does not further occur.
Copy file name to clipboardExpand all lines: tests/src/unit-diagnostics.cpp
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -74,7 +74,7 @@ TEST_CASE("Better diagnostics")
74
74
SECTION("Parse error")
75
75
{
76
76
json _;
77
-
CHECK_THROWS_WITH_AS(_ = json::parse(""), "[json.exception.parse_error.101] parse error at line 1, column 1: syntax error while parsing value - unexpected end of input; expected '[', '{', or a literal", json::parse_error);
77
+
CHECK_THROWS_WITH_AS(_ = json::parse(""), "[json.exception.parse_error.101] parse error at line 1, column 1: attempting to parse an empty input; check that your input string or stream contains the expected JSON", json::parse_error);
CHECK_THROWS_WITH_AS(_ = json::parse(f), "[json.exception.parse_error.101] parse error at line 1, column 1: syntax error while parsing value - unexpected end of input; expected '[', '{', or a literal", json::parse_error&);
725
+
CHECK_THROWS_WITH_AS(_ = json::parse(f), "[json.exception.parse_error.101] parse error at line 1, column 1: attempting to parse an empty input; check that your input string or stream contains the expected JSON", json::parse_error&);
// ss is not at EOF; this yielded an error before the fix
737
737
// (threw basic_string::append). No, it should just throw
738
738
// a parse error because of the EOF.
739
-
CHECK_THROWS_WITH_AS(ss >> j, "[json.exception.parse_error.101] parse error at line 1, column 1: syntax error while parsing value - unexpected end of input; expected '[', '{', or a literal", json::parse_error&);
739
+
CHECK_THROWS_WITH_AS(ss >> j, "[json.exception.parse_error.101] parse error at line 1, column 1: attempting to parse an empty input; check that your input string or stream contains the expected JSON", json::parse_error&);
740
740
}
741
741
742
742
SECTION("issue #367 - behavior of operator>> should more closely resemble that of built-in overloads")
CHECK_THROWS_WITH_AS(ss >> j, "[json.exception.parse_error.101] parse error at line 1, column 1: syntax error while parsing value - unexpected end of input; expected '[', '{', or a literal", json::parse_error&);
748
+
CHECK_THROWS_WITH_AS(ss >> j, "[json.exception.parse_error.101] parse error at line 1, column 1: attempting to parse an empty input; check that your input string or stream contains the expected JSON", json::parse_error&);
CHECK_THROWS_WITH_AS(ss >> j, "[json.exception.parse_error.101] parse error at line 1, column 1: syntax error while parsing value - unexpected end of input; expected '[', '{', or a literal", json::parse_error&);
768
+
CHECK_THROWS_WITH_AS(ss >> j, "[json.exception.parse_error.101] parse error at line 1, column 1: attempting to parse an empty input; check that your input string or stream contains the expected JSON", json::parse_error&);
CHECK_THROWS_WITH_AS(ss >> j, "[json.exception.parse_error.101] parse error at line 1, column 1: syntax error while parsing value - unexpected end of input; expected '[', '{', or a literal", json::parse_error&);
791
+
CHECK_THROWS_WITH_AS(ss >> j, "[json.exception.parse_error.101] parse error at line 1, column 1: attempting to parse an empty input; check that your input string or stream contains the expected JSON", json::parse_error&);
CHECK_THROWS_WITH_AS(ss >> j, "[json.exception.parse_error.101] parse error at line 1, column 1: syntax error while parsing value - unexpected end of input; expected '[', '{', or a literal", json::parse_error&);
806
+
CHECK_THROWS_WITH_AS(ss >> j, "[json.exception.parse_error.101] parse error at line 1, column 1: attempting to parse an empty input; check that your input string or stream contains the expected JSON", json::parse_error&);
CHECK_THROWS_WITH_AS(ss >> j, "[json.exception.parse_error.101] parse error at line 1, column 1: syntax error while parsing value - unexpected end of input; expected '[', '{', or a literal", json::parse_error&);
823
+
CHECK_THROWS_WITH_AS(ss >> j, "[json.exception.parse_error.101] parse error at line 1, column 1: attempting to parse an empty input; check that your input string or stream contains the expected JSON", json::parse_error&);
CHECK_THROWS_WITH_AS(ss >> j, "[json.exception.parse_error.101] parse error at line 1, column 1: syntax error while parsing value - unexpected end of input; expected '[', '{', or a literal", json::parse_error&);
836
+
CHECK_THROWS_WITH_AS(ss >> j, "[json.exception.parse_error.101] parse error at line 1, column 1: attempting to parse an empty input; check that your input string or stream contains the expected JSON", json::parse_error&);
0 commit comments