|
DocWire SDK
DocWire SDK: Deterministic, auditable, and secure data processing in C++20. On-premise by default. No compromises on computational speed.
|
Base class for all exceptions in the SDK. More...
#include <error.h>
Public Member Functions | |
| base (const source_location &location=source_location::current()) | |
| Constructs a base object with the current source location. | |
| base (const base &) | |
| base (base &&) | |
| base & | operator= (const base &) |
| base & | operator= (base &&) |
| virtual type_id | context_type_id (size_t index) const noexcept=0 |
| Get the type information of the context. | |
| virtual std::string | context_string (size_t index) const =0 |
| Get the string representation of the context. | |
| virtual size_t | context_count () const noexcept=0 |
| Get the number of context items. | |
| const char * | what () const noexcept override |
| Get the exception type. | |
Public Attributes | |
| source_location | location |
| The source location where the exception was thrown. | |
Base class for all exceptions in the SDK.
This class provides a foundation for exceptions in the SDK, combining the ability to throw any object as an exception with compatibility with the standard C++ exception class, std::exception.
The class is designed to hold context information of any type, such as error messages, error tags, or important context values. This information can be stored in the form of a string, a name-value pair, or any other C++ type.
In addition to the context information, this class also stores the source location where the exception was thrown. This information is useful for debugging and error reporting purposes.
| docwire::errors::base::base | ( | const source_location & | location = source_location::current() | ) |
Constructs a base object with the current source location.
| location | The source location of the exception (initialized by current location by default). |
|
pure virtualnoexcept |
Get the number of context items.
Implemented in docwire::errors::impl< T >.
|
pure virtual |
Get the string representation of the context.
| index | The index of the context item. |
Implemented in docwire::errors::impl< T >.
|
pure virtualnoexcept |
Get the type information of the context.
| index | The index of the context item. |
Implemented in docwire::errors::impl< T >.
|
overridenoexcept |
Get the exception type.
This method is provided for compatibility with the standard C++ exception class. It returns the type name of the exception instead of a formatted message for security reasons.
| source_location docwire::errors::base::location |
The source location where the exception was thrown.