forked from github/server
a little extra error handling for lua
This commit is contained in:
parent
29ea980738
commit
5f30d635dc
|
@ -92,6 +92,9 @@
|
|||
#include <lua.hpp>
|
||||
#include <luabind/luabind.hpp>
|
||||
|
||||
/* stdc++ includes */
|
||||
#include <stdexcept>
|
||||
|
||||
/* libc includes */
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
|
@ -684,9 +687,16 @@ main(int argc, char *argv[])
|
|||
#else
|
||||
try {
|
||||
#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
|
||||
}
|
||||
catch (std::runtime_error& rte) {
|
||||
log_error(("%s.\n", rte.what()));
|
||||
}
|
||||
catch (luabind::error& e) {
|
||||
lua_State* L = e.state();
|
||||
my_lua_error(L);
|
||||
|
|
18
src/todo.txt
18
src/todo.txt
|
@ -40,3 +40,21 @@ R_PERSON fix in vin2?
|
|||
|
||||
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
|
||||
|
||||
|
|
Loading…
Reference in New Issue