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

ReturnNameDescription
interr
std::stringmessage
std::exception_ptrexception

err

int err

message

std::string message

exception

std::exception_ptr exception

Public Methods

ReturnNameDescription
Error inlineDefault constructor; initializes all fields to a no-error state.
Error inlineConstructs an error with the given message string.
Error inlineConstructs an error with the given C string message.
boolany const inlineReturns true if any error condition is set (non-zero code, non-empty message, or exception).
voidreset inlineClears all error fields, resetting to a no-error state.
voidrethrow inlineRe-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

  • msg Human-readable error description.

Error

inline

inline Error(const char * msg)

Constructs an error with the given C string message.

Parameters

  • msg Human-readable error description.

any

const inline

inline bool any() const

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()

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.