forked from github/server
added exception handling
This commit is contained in:
parent
b6b5b9709b
commit
e208a2ba8d
|
@ -36,7 +36,18 @@ call_spell(castorder *co)
|
||||||
mage = co->familiar;
|
mage = co->familiar;
|
||||||
}
|
}
|
||||||
|
|
||||||
return luabind::call_function<int>(luaState, fname, co->rt, mage, co->level, co->force);
|
try {
|
||||||
|
return luabind::call_function<int>(luaState, fname, co->rt, mage, co->level, co->force);
|
||||||
|
}
|
||||||
|
catch (luabind::error& e) {
|
||||||
|
lua_State* L = e.state();
|
||||||
|
const char* error = lua_tostring(L, -1);
|
||||||
|
|
||||||
|
log_error((error));
|
||||||
|
lua_pop(L, 1);
|
||||||
|
std::terminate();
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue