From 3fd66be3798e4deea6509dc935fc01c0c68f31b4 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 26 Sep 2004 19:15:36 +0000 Subject: [PATCH] exception handling --- src/eressea/server.cpp | 6 +----- src/scripts/samples.lua | 3 ++- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/eressea/server.cpp b/src/eressea/server.cpp index cd54056f1..6b027203d 100644 --- a/src/eressea/server.cpp +++ b/src/eressea/server.cpp @@ -687,11 +687,7 @@ main(int argc, char *argv[]) #else try { #endif - 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); - } + luabind::call_function(luaState, "dofile", buf); #ifndef LUABIND_NO_EXCEPTIONS } catch (std::runtime_error& rte) { diff --git a/src/scripts/samples.lua b/src/scripts/samples.lua index b12f602d5..873cd5de3 100644 --- a/src/scripts/samples.lua +++ b/src/scripts/samples.lua @@ -213,7 +213,8 @@ function test_parser() write_game("parser") end -test_handler() +test_fail() +-- test_handler() -- test_parser() -- test_monsters() -- test_combat()