Skip to content
This repository has been archived by the owner on Jun 28, 2020. It is now read-only.

Commit

Permalink
Merge pull request #5 from darkjacky/master
Browse files Browse the repository at this point in the history
Replace LUA->ThrowError
  • Loading branch information
bkacjios authored Jan 1, 2017
2 parents 835ca86 + 275cd84 commit cf49078
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/gm_tmysql.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -433,8 +433,12 @@ void HandleQueryCallback(lua_State* state, Query* query)
// For some reason PCall crashes during shutdown??
if (LUA->PCall(args, 0, 0) != 0)
{
const char* err = LUA->GetString(-1);
LUA->ThrowError(err);
LUA->PushSpecial(GarrysMod::Lua::SPECIAL_GLOB);
LUA->GetField(-1, "ErrorNoHalt"); // could cache this function... but this really should not be called in the first place
LUA->Push(-3); // This is the error message from PCall
LUA->PushString("\n"); // add a newline since ErrorNoHalt does not do that itself
LUA->Call(2, 0);
LUA->Pop(2); // Pop twice since the PCall error is still on the stack
}
}

Expand Down

0 comments on commit cf49078

Please sign in to comment.