Update to latest Arbutils
Some checks failed
continuous-integration/drone/push Build is failing

Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
2020-08-16 17:41:56 +02:00
parent 56b92a22a6
commit a828e2d09c
3 changed files with 10 additions and 2 deletions

View File

@@ -1,7 +1,7 @@
#include "Core.hpp"
std::string ExceptionHandler::_creatureLibLastException = "";
std::string ExceptionHandler::_creatureLibLastExceptionStacktrace = "";
std::string ExceptionHandler::_creatureLibLastExceptionStacktrace = "Unset";
export const char* CreatureLib_C_GetLastException() { return ExceptionHandler::GetLastException(); }
export const char* CreatureLib_C_GetLastExceptionStacktrace() { return ExceptionHandler::GetLastExceptionStacktrace(); }

View File

@@ -21,11 +21,14 @@ public:
ss << "[" << function << "] " << e.what();
_creatureLibLastException = ss.str();
_creatureLibLastExceptionStacktrace = e.GetStacktrace(depth, true);
if (_creatureLibLastExceptionStacktrace.empty())
_creatureLibLastExceptionStacktrace = "err";
}
static void SetLastException(const std::string& function, const std::exception& e) {
std::stringstream ss;
ss << "[" << function << "] " << e.what();
_creatureLibLastException = ss.str();
_creatureLibLastExceptionStacktrace = "Exception did not have a stacktrace.";
}
static const char* GetLastException() { return _creatureLibLastException.c_str(); }
static const char* GetLastExceptionStacktrace() { return _creatureLibLastExceptionStacktrace.c_str(); }