split error message handler out of LuaPanic

This commit is contained in:
Glenn Maynard
2007-01-14 00:22:51 +00:00
parent c80639acbd
commit dd5baec8a5
+13 -1
View File
@@ -117,7 +117,7 @@ void LuaHelpers::ReadArrayFromTableB( Lua *L, vector<bool> &aOut )
}
static int LuaPanic( lua_State *L )
static int GetLuaStack( lua_State *L )
{
RString sErr;
LuaHelpers::Pop( L, sErr );
@@ -147,6 +147,18 @@ static int LuaPanic( lua_State *L )
join(",", vArgs).c_str(), file, ar.currentline );
}
LuaHelpers::Push( L, sErr );
return 1;
}
static int LuaPanic( lua_State *L )
{
GetLuaStack( L );
RString sErr;
LuaHelpers::Pop( L, sErr );
RageException::Throw( "%s", sErr.c_str() );
}