Skip to content

Exception

class Exception

Base class for Kernal exceptions.

constructor Exception()

constructor Exception(const char *format, ...)

Create an exception with a formatted message.

ParameterDescription
format

The format string for the message.

TYPE: const char *

...

The arguments for the format string.

constructor Exception(std::string message)

Create an exception with the given message.

ParameterDescription
message

The message of the exception.

TYPE: std::string

method Exception append_detail(const std::string &str)

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

ParameterDescription
str

The information to append.

TYPE: const std::string &

ReturnsDescription
Exception

The exception with the appended information.

method Exception append_system_error(std::optional< int > code)

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

ParameterDescription
code

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

TYPE: std::optional< int >

ReturnsDescription
Exception

The exception with the appended information.

method const char *what()

Get the message of the exception.

ReturnsDescription
const char *

The message of the exception.

member std::string message

The message of the exception.