rogue::GeneralError
Python binding
This C++ class is also exported into Python as rogue.GeneralError.
Python API page: - rogue.GeneralError
For conceptual usage, see:
-
class GeneralError : public std::exception
[header] Generic Rogue exception type.
Used for runtime errors that are not represented by a more specific exception class. Error messages are formatted as
source: messageand can be propagated to Python viasetup_python()andtranslate().Public Functions
-
GeneralError(std::string src, std::string text)
[header] [impl] 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:
src – Source/function context string.
text – Error message body.
Public Static Functions
-
static GeneralError create(std::string src, const char *fmt, ...)
[header] [impl] Creates a formatted error instance.
This static factory provides a consistent construction path for this class.
- Parameters:
src – Source/function context string.
fmt –
printf-style format string for the message body.
- Returns:
Constructed
GeneralError.
-
static void setup_python()
[header] [impl] Registers Python exception translation for
GeneralError.
-
static void translate(GeneralError const &e)
[header] [impl] Translates
GeneralErrorinto a Python exception.- Parameters:
e – Caught exception instance.
-
GeneralError(std::string src, std::string text)