From 3f5c3f1d2665aa319933ca70280db1e4b7601a13 Mon Sep 17 00:00:00 2001 From: Peter van Dijk Date: Mon, 10 Apr 2017 16:05:07 +0200 Subject: [PATCH] unnest Lua exceptions when they get all the way back to main() --- pdns/dnsdist.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pdns/dnsdist.cc b/pdns/dnsdist.cc index a74b8b25c8..da75bd83b3 100644 --- a/pdns/dnsdist.cc +++ b/pdns/dnsdist.cc @@ -2180,6 +2180,19 @@ try _exit(EXIT_SUCCESS); } +catch(const LuaContext::ExecutionErrorException& e) { + try { + errlog("Fatal Lua error: %s", e.what()); + std::rethrow_if_nested(e); + } catch(const std::exception& e) { + errlog("Details: %s", e.what()); + } + catch(PDNSException &ae) + { + errlog("Fatal pdns error: %s", ae.reason); + } + _exit(EXIT_FAILURE); +} catch(std::exception &e) { errlog("Fatal error: %s", e.what()); -- 2.47.2