Skip to content

Exception

#include <tpau-cpp-kernal/Exception.h>

INCLUDE FILE
#include <tpau-cpp-kernal/Exception.h>

class Exception

Base class for Kernal exceptions.

DEFINITION
class Exception;

constructor Exception

DEFINITION
Exception ( );

constructor Exception

Create an exception with a formatted message.

DEFINITION
template <typename...Args>
Exception ( std::format_string< Args... >  format,
Args &&...  args );
PARAMETERDESCRIPTION
format

The format string for the message.

args

The arguments for the format string.

constructor Exception

Create an exception with a message.

DEFINITION
Exception ( std::string_view  message );
PARAMETERDESCRIPTION
message

The message for the exception.

method append_detail

Create a new exception with additional information appended to the message.

DEFINITION
Exception  append_detail ( std::string_view  str );
PARAMETERDESCRIPTION
str

The information to append.

RETURNSDESCRIPTION
Exception

The exception with the appended information.

method append_system_error

Create a new exception with additional information about a system error appended to the message.

DEFINITION
Exception  append_system_error ( std::optional< int >  code );
PARAMETERDESCRIPTION
code

The error code to append. If not given, the current value of errno is used.

RETURNSDESCRIPTION
Exception

The exception with the appended information.

method emptyconst

Check if the exception's message is empty.

DEFINITION
bool  empty ( ) const;
RETURNSDESCRIPTION
bool

true if the exception has no message, false otherwise.

method whatconst

Get the message of the exception.

DEFINITION
const char * what ( ) const;
RETURNSDESCRIPTION
const char *

The message of the exception.

member message

The message of the exception.

DEFINITION
std::string  message;