rogue
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
rogue::GeneralError Class Reference

Generic Rogue exception type. More...

#include <GeneralError.h>

Inheritance diagram for rogue::GeneralError:

Public Member Functions

 GeneralError (std::string src, std::string text)
 Constructs an error from source and message text.
 
char const * what () const throw ()
 Returns exception text for standard exception handling.
 

Static Public Member Functions

static GeneralError create (std::string src, const char *fmt,...)
 Creates a formatted error instance.
 
static void setup_python ()
 Registers Python exception translation for GeneralError.
 
static void translate (GeneralError const &e)
 Translates GeneralError into a Python exception.
 

Detailed Description

Generic Rogue exception type.

Used for runtime errors that are not represented by a more specific exception class. Error messages are formatted as source: message and can be propagated to Python via setup_python() and translate().

Definition at line 45 of file GeneralError.h.

Constructor & Destructor Documentation

◆ GeneralError()

rogue::GeneralError::GeneralError ( std::string  src,
std::string  text 
)

Constructs an error from source and message text.

This constructor is a low-level C++ allocation path. Prefer create() when consistent factory semantics are desired.

Parameters
srcSource/function context string.
textError message body.

Definition at line 34 of file GeneralError.cpp.

Member Function Documentation

◆ create()

rogue::GeneralError rogue::GeneralError::create ( std::string  src,
const char *  fmt,
  ... 
)
static

Creates a formatted error instance.

This static factory provides a consistent construction path for this class.

Parameters
srcSource/function context string.
fmtprintf-style format string for the message body.
Returns
Constructed GeneralError.

Definition at line 38 of file GeneralError.cpp.

◆ setup_python()

void rogue::GeneralError::setup_python ( )
static

Registers Python exception translation for GeneralError.

Definition at line 53 of file GeneralError.cpp.

◆ translate()

void rogue::GeneralError::translate ( GeneralError const &  e)
static

Translates GeneralError into a Python exception.

Parameters
eCaught exception instance.

Definition at line 68 of file GeneralError.cpp.

◆ what()

char const * rogue::GeneralError::what ( ) const
throw (
)

Returns exception text for standard exception handling.

Returns
NUL-terminated message string.

Definition at line 49 of file GeneralError.cpp.


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