Base module
Error
Basic error type.
Error
#include <icy/error.h>Basic error type.
Errors contain an error code, message, and exception pointer.
Public Attributes
err
int errmessage
std::string messageexception
std::exception_ptr exceptionPublic Methods
| Return | Name | Description |
|---|---|---|
Error inline | Default constructor; initializes all fields to a no-error state. | |
Error inline | Constructs an error with the given message string. | |
Error inline | Constructs an error with the given C string message. | |
bool | any const inline | Returns true if any error condition is set (non-zero code, non-empty message, or exception). |
void | reset inline | Clears all error fields, resetting to a no-error state. |
void | rethrow inline | Re-throws the stored exception pointer if one is set. Has no effect if exception is null. |
Error
inline
inline Error()Default constructor; initializes all fields to a no-error state.
Error
inline
inline Error(const std::string & msg)Constructs an error with the given message string.
Parameters
msgHuman-readable error description.
Error
inline
inline Error(const char * msg)Constructs an error with the given C string message.
Parameters
msgHuman-readable error description.
any
const inline
inline bool any() constReturns true if any error condition is set (non-zero code, non-empty message, or exception).
Returns
True if an error is present.
reset
inline
inline void reset()Clears all error fields, resetting to a no-error state.
rethrow
inline
inline void rethrow()Re-throws the stored exception pointer if one is set. Has no effect if exception is null.
