![]() |
Argo
1.0
A C++ library for handling JSON.
|
Base class for all exceptions thrown by the library. More...
#include <json_exception.hpp>
Public Member Functions | |
json_exception (exception_type et) noexcept | |
json_exception (exception_type et, const char *json_type_name) noexcept | |
json_exception (exception_type et, const char *first_json_type_name, const char *second_json_type_name) noexcept | |
exception_type | get_type () const noexcept |
virtual const char * | what () const noexcept |
Static Public Attributes | |
static const int | max_message_length = 200 |
Maximum length of the message that may be returned by the what() method. | |
Protected Attributes | |
char | m_message [max_message_length] |
exception_type | m_type |
Base class for all exceptions thrown by the library.
Base class for all exceptions thrown by the library. All exeption types are defined here but subclasses are defined to provide specialised error message and extra parameters (e.g. the byte index where a JSON parsing error occured). For code that doesn't need to know anything about the specific exception and just wants to log an error message before exiting or continuing, catch exceptions of this class and call what() to get some human readable English text.
Definition at line 46 of file json_exception.hpp.
The type of the exception. It's a bit clunky but this also includes all the types for derived classes. That keeps the amount of code to a minimum and provides a single place to look up exception types. This exception class is really not intended to be subclassed outside of the library so that's not so bad.
Definition at line 60 of file json_exception.hpp.
|
noexcept |
Constructor.
Definition at line 34 of file json_exception.cpp.
|
noexcept |
Constructor when the error is a type related problem.
Definition at line 62 of file json_exception.cpp.
|
noexcept |
Constructor when the error is a type related problem involving two objects.
Definition at line 87 of file json_exception.cpp.
|
noexcept |
Get the type of the exception. More details can be obtained for some sub-class exception types by calling methods specific to them.
Definition at line 107 of file json_exception.cpp.
|
virtualnoexcept |
Get a human readable English error message that can be used for logging or debugging purposes.
Definition at line 102 of file json_exception.cpp.
|
protected |
Error message. Held this way so as to allow the what() method to be declared noexcept.
Definition at line 183 of file json_exception.hpp.
|
protected |
Specific type of the exception. Note that derived classes use this one too and don't define their own types.
Definition at line 189 of file json_exception.hpp.