From c9c89ad50375ac1cf223f715749fd822827eea67 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Tue, 19 Mar 2013 10:23:11 +0100 Subject: [PATCH] luainstance: add minimal error reporting --- src/gui/luainstance.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gui/luainstance.cpp b/src/gui/luainstance.cpp index 8fda14245..d789a38a5 100644 --- a/src/gui/luainstance.cpp +++ b/src/gui/luainstance.cpp @@ -25,6 +25,7 @@ #include #include +#include #include #include "luainstance.h" @@ -122,7 +123,11 @@ void CLuaInstance::runScript(const char *fileName) status = lua_pcall(lua, 0, LUA_MULTRET, 0); if (status) + { fprintf(stderr, "[CLuaInstance::%s] error in script: %s\n", __func__, lua_tostring(lua, -1)); + ShowMsg2UTF("Lua script error:", lua_tostring(lua, -1), CMsgBox::mbrBack, CMsgBox::mbBack); + } + } const luaL_Reg CLuaInstance::methods[] =