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; }
68 #define FIFE_EXCEPTION_DECL(_name, _description) \ 69 class _name : public Exception { \ 71 _name(const std::string& msg) : Exception(msg) { Logger _log(LM_EXCEPTION); update(); FL_ERR(_log, what()); } \ 72 const std::string& getTypeStr() const { static const std::string s = #_name; return s; } \ 73 const std::string& getDescription() const { static const std::string s = _description; return s; } \ 89 FIFE_EXCEPTION_DECL(InconsistencyDetected,
"An inconsistency in FIFE internals was detected. Please report this is a FIFE Bug.");
FIFE_EXCEPTION_DECL(SDLException, "SDL reported something bad")
virtual ~Exception()
Destructor.
virtual const std::string & getDescription() const
virtual const std::string & getTypeStr() const
Exception(const std::string &msg)
Constructor.
virtual const char * what() const
Returns the error message.