1 #ifndef _json_exception_hpp_ 2 #define _json_exception_hpp_ 51 static const int max_message_length = 200;
141 syntax_error_in_pointer_string_e
153 json_exception(exception_type et,
const char *json_type_name) noexcept;
161 const char *first_json_type_name,
162 const char *second_json_type_name) noexcept;
169 exception_type get_type() const noexcept;
175 virtual const
char *what() const noexcept;
183 char m_message[max_message_length];
189 exception_type m_type;
The POSIX read() system call returned an unexpected value.
Base class for all exceptions thrown by the library.
The stdio fwrite() system call failed.
#define NAMESPACE
You can change the namespace of the whole library by changing this value.
Internal error - the m_type member variable has an invalid value.
Attempt to to access an index in an array object that is out of range.
Internal error, couldn't determine the length of a UTF-8 sequence.
Maximum message length was exceeded.
A string had too many characters in it.
A number had too many characters in it.
A number was too large or small to convert accrurately to an int or double.
Attempt to call a method that assumes the json instance is an array.
Internal error, invalid hex number was found (< 0 or > 15).
An invalid UTF-8 character was found decoding or encoding a string.
Attempt to access a non-existent slot in a json instance.
Attempt to put back more than one character onto a reader.
Common defs needed everywhere and, as far as is possible, platform specific changes.
Invalid hex character was found. (e.g. "\uAA8Z").
Attempt to open file failed.
An invalid JSON character escape was found in a string. e.g. "\P".
Invalid pointer token type.
The file ended where more tokens were expected.
Attempt to call a method that assumes the json instance is an int or double.
Pointer doesn't point to anything in the json instance.
Raw values cannot be directly compared.
The POSIX read() system call failed.
Attempt to call a method that assumes the json instance is an object.
Attempt to construct an instance with a raw value that isn't a number or a string.
A string encoding of some sort was invalid (e.g. "\uAA").
Something that looked like a number ended up not being (e.g. 1234AAAA).
Maximum nesting depth exceeded.
Tried to compare two different types (e.g. int vs string)
An invalid character was found during parsing (e.g. ! outside of a string).
An invalid unicode code point was found when parsing a JSON string.
Attempt to call a method that assumes the json instance is a string.
Raw values cannot be cast.
A valid, but unexpected, lexical token was found (e.g. { {).
Attempt to call a method that assumes the json instance is a boolean or castable to one...
The POSIX write() system call failed.
The stdio fgetc call failed in an unexpected way.