a little extra error handling for lua

This commit is contained in:
Enno Rehling 2004-09-26 18:49:57 +00:00
parent 29ea980738
commit 5f30d635dc
2 changed files with 29 additions and 1 deletions

View File

@ -92,6 +92,9 @@
#include <lua.hpp> #include <lua.hpp>
#include <luabind/luabind.hpp> #include <luabind/luabind.hpp>
/* stdc++ includes */
#include <stdexcept>
/* libc includes */ /* libc includes */
#include <cstdio> #include <cstdio>
#include <cstdlib> #include <cstdlib>
@ -684,9 +687,16 @@ main(int argc, char *argv[])
#else #else
try { try {
#endif #endif
lua_dofile(luaState, buf); if (lua_dofile(luaState, buf)!=0) {
std::string errmsg = "Unknown error executing lua_dofile";
if (lua_isstring(luaState, -1)) errmsg = lua_tostring(luaState, -1);
throw std::runtime_error(errmsg);
}
#ifndef LUABIND_NO_EXCEPTIONS #ifndef LUABIND_NO_EXCEPTIONS
} }
catch (std::runtime_error& rte) {
log_error(("%s.\n", rte.what()));
}
catch (luabind::error& e) { catch (luabind::error& e) {
lua_State* L = e.state(); lua_State* L = e.state();
my_lua_error(L); my_lua_error(L);

View File

@ -40,3 +40,21 @@ R_PERSON fix in vin2?
calendar in XML calendar in XML
unterschiede in vin3 + wdw per config statt defines?
#define NEWATSROI 1
#define ATSBONUS 2
#define ROIBONUS 4
#define WDW_PHOENIX
#define WDW_PYRAMIDSPE
LL
#define NEW_STARTEQUIPMENT
#define ARENA_MODULE
#define WORMHOLE_MODULE
mailit-format ändern?
age branch mergen