From: Charles-Henri Bruyand Date: Thu, 19 Apr 2018 09:49:28 +0000 (+0200) Subject: rethrow lua execution exception with reason X-Git-Tag: dnsdist-1.3.1~136^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2186a96402544b98c72cfffa0fc21821a4364a1d;p=thirdparty%2Fpdns.git rethrow lua execution exception with reason --- 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"}); }