Update for newer base libraries, improves error messages.
This commit is contained in:
@@ -1,6 +0,0 @@
|
||||
#ifndef POKEMONSCRIPTTESTER_PRECOMPILED_HXX
|
||||
#define POKEMONSCRIPTTESTER_PRECOMPILED_HXX
|
||||
|
||||
#include <PkmnLib/Precompiled.hxx>
|
||||
|
||||
#endif // POKEMONSCRIPTTESTER_PRECOMPILED_HXX
|
||||
@@ -25,7 +25,7 @@ class MiscMockFunctions {
|
||||
|
||||
auto move = Globals::Library.GetValue()->GetMoveLibrary()->TryGet(moveName);
|
||||
if (!move.has_value()) {
|
||||
return {};
|
||||
THROW("Unknown move: " << moveName);
|
||||
}
|
||||
auto learnedMove =
|
||||
new PkmnLib::Battling::LearnedMove(move.value(), CreatureLib::Battling::AttackLearnMethod::Unknown);
|
||||
|
||||
@@ -26,7 +26,13 @@ public:
|
||||
|
||||
_env->CollectGarbage();
|
||||
if (e == asEXECUTION_EXCEPTION) {
|
||||
_errorMessage = ctx->GetExceptionString();
|
||||
std::stringstream error;
|
||||
const char* exceptionSection = "";
|
||||
int exceptionColumn = 0;
|
||||
auto exceptionLine = ctx->GetExceptionLineNumber(&exceptionColumn, &exceptionSection);
|
||||
error << "[" << exceptionSection << ":" << exceptionLine << "," << exceptionColumn << "] "
|
||||
<< ctx->GetExceptionString();
|
||||
_errorMessage = error.str();
|
||||
_result = TestResult::Failed;
|
||||
ctx->PopState();
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user