diff --git a/home/exceptions.md b/home/exceptions.md index caebedc6d..1a1df8c3c 100644 --- a/home/exceptions.md +++ b/home/exceptions.md @@ -381,7 +381,7 @@ Exceptions have ids 1xx. This error indicates a syntax error while deserializing a JSON text. The error message describes that an unexpected token (character) was encountered, and the member `byte` indicates the error position. -The message ends with the last read token (`last read: '...'`), with control characters written as ``. A token of more than 8192 characters is shown by its first and its last 4096 characters, separated by `...`. +The message ends with the last read token (`last read: '...'`), with control characters written as ``. A token of more than 8192 bytes is shown by its first and its last 4096 bytes, separated by `...`; each part is shortened by up to three bytes so that it does not end or begin within a UTF-8 character. !!! failure "Example message" diff --git a/home/exceptions/index.html b/home/exceptions/index.html index 5de7b3a24..9892c0c33 100644 --- a/home/exceptions/index.html +++ b/home/exceptions/index.html @@ -89,7 +89,7 @@
Output:
message: [json.exception.parse_error.101] parse error at line 1, column 8: syntax error while parsing value - unexpected ']'; expected '[', '{', or a literal
exception id: 101
byte position of error: 8
-This error indicates a syntax error while deserializing a JSON text. The error message describes that an unexpected token (character) was encountered, and the member byte indicates the error position.
The message ends with the last read token (last read: '...'), with control characters written as <U+XXXX>. A token of more than 8192 characters is shown by its first and its last 4096 characters, separated by ....
Example message
Input ended prematurely:
[json.exception.parse_error.101] parse error at 2: unexpected end of input; expected string literal
+This error indicates a syntax error while deserializing a JSON text. The error message describes that an unexpected token (character) was encountered, and the member byte indicates the error position.
The message ends with the last read token (last read: '...'), with control characters written as <U+XXXX>. A token of more than 8192 bytes is shown by its first and its last 4096 bytes, separated by ...; each part is shortened by up to three bytes so that it does not end or begin within a UTF-8 character.
Example message
Input ended prematurely:
[json.exception.parse_error.101] parse error at 2: unexpected end of input; expected string literal
No input:
[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
Control character was not escaped:
[json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value - invalid string: control character U+0009 (HT) must be escaped to \u0009 or \\; last read: '"<U+0009>'"
String was not closed:
[json.exception.parse_error.101] parse error at line 1, column 2: syntax error while parsing value - invalid string: missing closing quote; last read: '"'
@@ -307,4 +307,4 @@ exception id: 401
exception id: 501
A JSON Patch operation 'test' failed. The unsuccessful operation is also printed.
Example message
Executing {"op":"test", "path":"/baz", "value":"bar"} on {"baz": "qux"}:
[json.exception.other_error.501] unsuccessful: {"op":"test","path":"/baz","value":"bar"}
to_ubjson and to_bjdata were called with use_type = true but use_size = false, and the value contains a non-empty array, object, or binary value (with BJData Draft 3, any binary value, including an empty one). UBJSON requires a size marker (#) after a type marker ($); scalars and empty arrays or objects do not throw.
Example message
[json.exception.other_error.502] use_type requires use_size = true
-Note
This exception was added in version 3.13.0 unreleased. Before that, debug builds aborted on an assertion and release builds wrote a $ marker without #, which from_ubjson then rejected.
exception - base class of all exceptions thrown by the libraryparse_error - exceptions indicating a parse errorinvalid_iterator - exceptions indicating errors with iteratorstype_error - exceptions indicating a wrong typeout_of_range - exceptions indicating access out of rangeother_error - exceptions indicating other library errorsJSON_NOEXCEPTION - switch off exceptionsJSON_DIAGNOSTICS - extended exception messages with the path of the failing value