void check_result(lua_State * L, int result) { if (result) { if (is_exception(L, -1)) { to_exception(L, -1).rethrow(); } else { throw script_exception(lua_tostring(L, -1)); } } }
static void exception_migrate(lua_State * src, int i, lua_State * tgt) { push_exception(tgt, to_exception(src, i)); }
static int exception_what(lua_State * L) { return push_string(L, to_exception(L, 1).what()); }