]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
unnest Lua exceptions when they get all the way back to main() 5230/head
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Mon, 10 Apr 2017 14:05:07 +0000 (16:05 +0200)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Mon, 10 Apr 2017 14:05:07 +0000 (16:05 +0200)
pdns/dnsdist.cc

index a74b8b25c8825686da3aa82f0082cddfb8076e61..da75bd83b366f51357fd58ea36827970d3c20888 100644 (file)
@@ -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());