Skip to content
Permalink
Browse files

Fix LuaJIT exception wrapper

  • Loading branch information...
kahrl committed Aug 23, 2014
1 parent f33d316 commit 3e267a6ece99b0affa1e0d5c15fb21c1b60dd63d
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/script/common/c_internal.cpp
@@ -64,8 +64,10 @@ int script_exception_wrapper(lua_State *L, lua_CFunction f)
return f(L); // Call wrapped function and return result.
} catch (const char *s) { // Catch and convert exceptions.
lua_pushstring(L, s);
} catch (LuaError& e) {
} catch (std::exception& e) {
lua_pushstring(L, e.what());
} catch (...) {
lua_pushliteral(L, "caught (...)");
}
return lua_error(L); // Rethrow as a Lua error.
}

0 comments on commit 3e267a6

Please sign in to comment.
You can’t perform that action at this time.