More clearer exception messages.

This commit is contained in:
2020-07-30 20:15:27 +02:00
parent 29013bb6ac
commit b3b9698831
2 changed files with 16 additions and 9 deletions

View File

@@ -17,4 +17,12 @@ public:
___ss << "[" << __FILENAME__ << ":" << __LINE__ << "] " << message; \
throw CreatureException(___ss.str());
#define try_creature(data, msg) \
try { \
data; \
} catch (const CreatureException& e) { \
throw e; \
} catch (const std::exception& e) { \
THROW_CREATURE(msg << ": '" << e.what() << "'."); \
}
#endif // CREATURELIB_CREATUREEXCEPTION_HPP