MCPcopy Create free account
hub / github.com/TASEmulators/fceux / HandleCallbackError

Function HandleCallbackError

src/lua-engine.cpp:2086–2110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2084
2085
2086void HandleCallbackError(lua_State* L)
2087{
2088 //if(L->errfunc || L->errorJmp)
2089 // luaL_error(L, "%s", lua_tostring(L,-1));
2090 //else
2091 {
2092 const char *trace = CallLuaTraceback(L);
2093
2094 lua_pushnil(L);
2095 lua_setfield(L, LUA_REGISTRYINDEX, guiCallbackTable);
2096
2097 char errmsg [2048];
2098 sprintf(errmsg, "%s\n%s", lua_tostring(L,-1), trace);
2099
2100 // Error?
2101#ifdef __WIN_DRIVER__
2102 MessageBox( hAppWnd, errmsg, "Lua run error", MB_OK | MB_ICONSTOP);
2103#else
2104 LuaPrintfToWindowConsole("Lua thread bombed out: %s\n", errmsg);
2105 fprintf(stderr, "Lua thread bombed out: %s\n", errmsg);
2106#endif
2107
2108 FCEU_LuaStop();
2109 }
2110}
2111
2112
2113// the purpose of this structure is to provide a way of

Callers 3

CallExitFunctionFunction · 0.85

Calls 5

CallLuaTracebackFunction · 0.85
lua_pushnilFunction · 0.85
lua_setfieldFunction · 0.85
FCEU_LuaStopFunction · 0.85
LuaPrintfToWindowConsoleFunction · 0.50

Tested by

no test coverage detected