| 2084 | |
| 2085 | |
| 2086 | void 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 |
no test coverage detected