22 #ifndef FIFE_EXCEPTION_H
23 #define FIFE_EXCEPTION_H
57 virtual const char*
what()
const throw();
59 virtual const std::string&
getTypeStr()
const {
static const std::string s =
"Exception";
return s; }
60 virtual const std::string&
getDescription()
const {
static const std::string s =
"Generic FIFE exception";
return s; }
66 #define FIFE_EXCEPTION_DECL(_name, _description) \
67 class _name : public Exception { \
69 _name(const std::string& msg) : Exception(msg) { Logger _log(LM_EXCEPTION); FL_ERR(_log, what()); } \
70 const std::string& getTypeStr() const { static const std::string s = #_name; return s; } \
71 const std::string& getDescription() const { static const std::string s = _description; return s; } \
87 FIFE_EXCEPTION_DECL(InconsistencyDetected,
"An inconsistency in FIFE internals was detected. Please report this is a FIFE Bug.");
virtual const char * what() const
Returns the error message.
virtual ~Exception()
Destructor.
Exception(const std::string &msg)
Constructor.
virtual const std::string & getDescription() const
FIFE_EXCEPTION_DECL(SDLException,"SDL reported something bad")
virtual const std::string & getTypeStr() const