Skip to content

Instantly share code, notes, and snippets.

@chbruyand
Created April 30, 2018 16:01
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 chbruyand/586820716b128cf680d12599fd46adc7 to your computer and use it in GitHub Desktop.
Save chbruyand/586820716b128cf680d12599fd46adc7 to your computer and use it in GitHub Desktop.
diff --git a/ext/luawrapper/include/LuaContext.hpp b/ext/luawrapper/include/LuaContext.hpp
index 8075aea79..fd22605c4 100644
--- a/ext/luawrapper/include/LuaContext.hpp
+++ b/ext/luawrapper/include/LuaContext.hpp
@@ -2366,9 +2366,15 @@ private:
lua_pushstring(state, ex.luaType.c_str());
lua_pushstring(state, " to ");
lua_pushstring(state, ex.destination.name());
- lua_concat(state, 4);
+ lua_concat(state, 5);
luaError(state);
+ } catch (const std::exception& e) {
+ luaL_where(state, 1);
+ lua_pushstring(state, "Caught exception: ");
+ lua_pushstring(state, e.what());
+ lua_concat(state, 3);
+ luaError(state);
} catch (...) {
Pusher<std::exception_ptr>::push(state, std::current_exception()).release();
luaError(state);
@ahupowerdns
Copy link

I don't quite get the change on line 9,/10 is that a bug fix?

@chbruyand
Copy link
Author

chbruyand commented May 23, 2018

IMO (I don't get why it was 4)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment