From 2186a96402544b98c72cfffa0fc21821a4364a1d Mon Sep 17 00:00:00 2001 From: Charles-Henri Bruyand Date: Thu, 19 Apr 2018 11:49:28 +0200 Subject: [PATCH] rethrow lua execution exception with reason --- ext/luawrapper/include/LuaContext.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ext/luawrapper/include/LuaContext.hpp b/ext/luawrapper/include/LuaContext.hpp index 6eb2e7b77f..8075aea798 100644 --- a/ext/luawrapper/include/LuaContext.hpp +++ b/ext/luawrapper/include/LuaContext.hpp @@ -1438,6 +1438,8 @@ private: if (const auto exp = readTopAndPop(state, std::move(errorCode))) { std::rethrow_exception(exp); } + } catch(const std::exception& e) { + std::throw_with_nested(ExecutionErrorException{std::string{"Exception thrown by a callback function: "} + e.what()}); } catch(...) { std::throw_with_nested(ExecutionErrorException{"Exception thrown by a callback function called by Lua"}); } -- 2.47.2