Error
Error
#include <icy/error.h>struct ErrorDefined in src/base/include/icy/error.h:32
Basic error type.
Errors contain an error code, message, and exception pointer.
List of all members
| Name | Kind | Owner |
|---|---|---|
operator<< | friend | Declared here |
err | variable | Declared here |
message | variable | Declared here |
exception | variable | Declared here |
Error | function | Declared here |
Error | function | Declared here |
Error | function | Declared here |
any | function | Declared here |
reset | function | Declared here |
rethrow | function | Declared here |
Friends
| Name | Description |
|---|---|
operator<< inline |
operator<<
inline
friend inline std::ostream & operator<<(std::ostream & stream, const Error & err)Defined in src/base/include/icy/error.h:80
Public Attributes
err
int errDefined in src/base/include/icy/error.h:34
message
std::string messageDefined in src/base/include/icy/error.h:35
exception
std::exception_ptr exceptionDefined in src/base/include/icy/error.h:36
Public 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()Defined in src/base/include/icy/error.h:39
Default constructor; initializes all fields to a no-error state.
Error
inline
inline Error(const std::string & msg)Defined in src/base/include/icy/error.h:43
Constructs an error with the given message string.
Parameters
msgHuman-readable error description.
Error
inline
inline Error(const char * msg)Defined in src/base/include/icy/error.h:51
Constructs an error with the given C string message.
Parameters
msgHuman-readable error description.
any
const inline
inline bool any() constDefined in src/base/include/icy/error.h:59
Returns 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()Defined in src/base/include/icy/error.h:65
Clears all error fields, resetting to a no-error state.
rethrow
inline
inline void rethrow()Defined in src/base/include/icy/error.h:74
Re-throws the stored exception pointer if one is set. Has no effect if exception is null.
