From: ShadowNinja Date: Sat, 30 Nov 2013 17:24:54 +0000 (-0500) Subject: Add error handler to async step X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=4696c59a5f3ad5884d57c7848207c39950f7052e;p=zefram%2Fminetest%2Fminetest_engine.git Add error handler to async step --- diff --git a/src/script/lua_api/l_async_events.cpp b/src/script/lua_api/l_async_events.cpp index 63ca87ae..8cd83568 100644 --- a/src/script/lua_api/l_async_events.cpp +++ b/src/script/lua_api/l_async_events.cpp @@ -29,36 +29,7 @@ int luaopen_marshal(lua_State *L); #include "log.h" #include "filesys.h" #include "porting.h" - -//TODO replace by ShadowNinja version not yet merged to master -static int script_error_handler(lua_State *L) { - lua_getfield(L, LUA_GLOBALSINDEX, "debug"); - if (!lua_istable(L, -1)) { - lua_pop(L, 1); - return 1; - } - lua_getfield(L, -1, "traceback"); - if (!lua_isfunction(L, -1)) { - lua_pop(L, 2); - return 1; - } - lua_pushvalue(L, 1); - lua_pushinteger(L, 2); - lua_call(L, 2, 1); - return 1; -} - -/******************************************************************************/ -static void scriptError(const char *fmt, ...) -{ - va_list argp; - va_start(argp, fmt); - char buf[10000]; - vsnprintf(buf, 10000, fmt, argp); - va_end(argp); - errorstream<<"ERROR: "<