From: Peter van Dijk Date: Mon, 10 Apr 2017 14:05:07 +0000 (+0200) Subject: unnest Lua exceptions when they get all the way back to main() X-Git-Tag: rec-4.1.0-alpha1~161^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F5230%2Fhead;p=thirdparty%2Fpdns.git unnest Lua exceptions when they get all the way back to main() --- 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());