Skip to content

Instantly share code, notes, and snippets.

@kahrl
Created August 14, 2014 18:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kahrl/c81254227e11f09fd31f to your computer and use it in GitHub Desktop.
Save kahrl/c81254227e11f09fd31f to your computer and use it in GitHub Desktop.
diff --git a/src/script/common/c_internal.cpp b/src/script/common/c_internal.cpp
index 4c098f8..0d03468 100644
--- a/src/script/common/c_internal.cpp
+++ b/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_pushstring(L, "(...) caught");
}
return lua_error(L); // Rethrow as a Lua error.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment