27 #include <boost/python.hpp>
28namespace bp = boost::python;
35 snprintf(text_, BuffSize,
"%s: General Error: %s", src.c_str(), text.c_str());
43 vsnprintf(temp, BuffSize, fmt, args);
56 bp::class_<rogue::GeneralError>(
"GeneralError", bp::init<std::string, std::string>());
58 PyObject* typeObj = PyErr_NewException(
const_cast<char*
>(
"rogue.GeneralError"), PyExc_Exception, 0);
59 bp::scope().attr(
"GeneralError") = bp::handle<>(bp::borrowed(typeObj));
74 exc_t.attr(
"cause") = exc;
Generic Rogue exception type.
static void translate(GeneralError const &e)
Translates GeneralError into a Python exception.
GeneralError(std::string src, std::string text)
Constructs an error from source and message text.
char const * what() const
Returns exception text for standard exception handling.
static void setup_python()
Registers Python exception translation for GeneralError.
static GeneralError create(std::string src, const char *fmt,...)
Creates a formatted error instance.
PyObject * generalErrorObj