More reworks of exceptions.

This commit is contained in:
2020-07-26 17:29:06 +02:00
parent 9ec41fdd2d
commit 29eb7c603a
2 changed files with 5 additions and 4 deletions

View File

@@ -3,6 +3,7 @@
#include <stdexcept>
#include <string>
#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
class CreatureException : public std::runtime_error {
public:
@@ -12,6 +13,6 @@ public:
#define THROW_CREATURE(message) \
std::stringstream ss; \
ss << message; \
ss << "[" << __FILENAME__ << ", " << __LINE__ << "] " << message; \
throw CreatureException(ss.str());
#endif // CREATURELIB_CREATUREEXCEPTION_HPP