MXVM 1.8.1
Virtual Machine, Compiler, and Pascal Frontend
Loading...
Searching...
No Matches
mx::Exception Class Reference

General-purpose exception with errno-aware factory method. More...

#include <exception.hpp>

Inheritance diagram for mx::Exception:

Public Member Functions

 Exception (const std::string &message)
 Construct an exception from a string message.
 Exception (const char *message)
 Construct an exception from a C string message.

Static Public Member Functions

static Exception error (const std::string &context)
 Create an exception with errno appended.

Detailed Description

General-purpose exception with errno-aware factory method.

Extends std::runtime_error. The static error() method appends strerror(errno) to the context string.

Definition at line 38 of file exception.hpp.

Constructor & Destructor Documentation

◆ Exception() [1/2]

mx::Exception::Exception ( const std::string & message)
inlineexplicit

Construct an exception from a string message.

Parameters
messageHuman-readable error description

Definition at line 44 of file exception.hpp.

Referenced by error().

◆ Exception() [2/2]

mx::Exception::Exception ( const char * message)
inlineexplicit

Construct an exception from a C string message.

Parameters
messageHuman-readable error description

Definition at line 51 of file exception.hpp.

Member Function Documentation

◆ error()

Exception mx::Exception::error ( const std::string & context)
inlinestatic

Create an exception with errno appended.

Parameters
contextDescriptive context prefix
Returns
Exception with "context: strerror(errno)" message

Definition at line 59 of file exception.hpp.

References Exception().


The documentation for this class was generated from the following file: