rogue
Loading...
Searching...
No Matches
GeneralError.h
Go to the documentation of this file.
1
17#ifndef __ROGUE_GENERAL_ERROR_H__
18#define __ROGUE_GENERAL_ERROR_H__
19#include "rogue/Directives.h"
20
21#include <stdint.h>
22
23#include <exception>
24#include <memory>
25#include <string>
26
27#ifndef NO_PYTHON
28 #include <boost/python.hpp>
29#endif
30
31namespace rogue {
32
33#ifndef NO_PYTHON
34extern PyObject* generalErrorObj;
35#endif
36
45class GeneralError : public std::exception {
46 static const uint32_t BuffSize = 600;
47
48 char text_[BuffSize];
49
50 public:
61 GeneralError(std::string src, std::string text);
62
73 static GeneralError create(std::string src, const char* fmt, ...);
74
79 char const* what() const throw();
80
82 static void setup_python();
83
88 static void translate(GeneralError const& e);
89};
90} // namespace rogue
91
92#endif
Generic Rogue exception type.
static void translate(GeneralError const &e)
Translates GeneralError into a Python exception.
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