Added error handling in wren. Game while abort lauching and print error in logger

This commit is contained in:
Antoine Pilote
2021-07-03 18:31:32 -04:00
parent f5bcb12f61
commit b384154eb4
14 changed files with 50 additions and 22 deletions

View File

@@ -23,13 +23,13 @@ void errorFn(WrenVM* vm, WrenErrorType errorType,
{
case WREN_ERROR_COMPILE:
{
std::string t = "Script error in: " + std::string(module)+ " line:" + std::to_string(line) + " \n error: "+ msg;
std::string t = std::string(module)+ " line " + std::to_string(line) + ": "+ msg;
Logger::Log(t, CRITICAL);
Engine::ExitPlayMode();
} break;
case WREN_ERROR_STACK_TRACE:
{
std::string t = "Script Stack trace: " + std::string(module) + " line:" + std::to_string(line) + " \n stack: " + msg;
std::string t = "Stack trace: " + std::string(module) + " line " + std::to_string(line) + ": " + msg;
Logger::Log(t, CRITICAL);
} break;
case WREN_ERROR_RUNTIME: