Further work on better exceptions.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#ifndef CREATURELIB_CREATUREEXCEPTION_HPP
|
||||
#define CREATURELIB_CREATUREEXCEPTION_HPP
|
||||
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
|
||||
@@ -12,7 +13,9 @@ public:
|
||||
};
|
||||
|
||||
#define THROW_CREATURE(message) \
|
||||
std::stringstream ss; \
|
||||
ss << "[" << __FILENAME__ << ", " << __LINE__ << "] " << message; \
|
||||
throw CreatureException(ss.str());
|
||||
{ \
|
||||
std::stringstream ss; \
|
||||
ss << "[" << __FILENAME__ << ":" << __LINE__ << "] " << message; \
|
||||
throw CreatureException(ss.str()); \
|
||||
}
|
||||
#endif // CREATURELIB_CREATUREEXCEPTION_HPP
|
||||
|
||||
Reference in New Issue
Block a user