Use Arbutils exception Macros, instead of own ones.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
@@ -2,18 +2,6 @@
|
||||
#define CREATURELIB_CREATUREEXCEPTION_HPP
|
||||
|
||||
#include <Arbutils/Exception.hpp>
|
||||
#include <cstring>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
|
||||
|
||||
#define THROW_CREATURE(message) \
|
||||
std::stringstream ___ss; \
|
||||
___ss << "[" << __FILENAME__ << ":" << __LINE__ << "] " << message; \
|
||||
throw ArbUt::Exception(___ss.str());
|
||||
#define NOT_REACHABLE THROW_CREATURE("Not reachable");
|
||||
#define NOT_IMPLEMENTED THROW_CREATURE("Not implemented");
|
||||
|
||||
#define try_creature(data, msg) \
|
||||
try { \
|
||||
@@ -21,6 +9,6 @@
|
||||
} catch (const ArbUt::Exception& e) { \
|
||||
throw e; \
|
||||
} catch (const std::exception& e) { \
|
||||
THROW_CREATURE(msg << ": '" << e.what() << "'."); \
|
||||
THROW(msg << ": '" << e.what() << "'."); \
|
||||
}
|
||||
#endif // CREATURELIB_CREATUREEXCEPTION_HPP
|
||||
|
||||
Reference in New Issue
Block a user