]> granicus.if.org Git - pdns/commitdiff
rethrow lua execution exception with reason
authorCharles-Henri Bruyand <charles-henri.bruyand@open-xchange.com>
Thu, 19 Apr 2018 09:49:28 +0000 (11:49 +0200)
committerCharles-Henri Bruyand <charles-henri.bruyand@open-xchange.com>
Thu, 19 Apr 2018 09:49:28 +0000 (11:49 +0200)
ext/luawrapper/include/LuaContext.hpp

index 6eb2e7b77ffebc7d88f053065ca5a4e8b9fc4074..8075aea7987d2a9e60affa8967542ae87f2dadb9 100644 (file)
@@ -1438,6 +1438,8 @@ private:
                         if (const auto exp = readTopAndPop<std::exception_ptr>(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"});
                     }