]> granicus.if.org Git - pdns/commitdiff
LUA: report nested exception
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Fri, 25 Jan 2019 18:44:19 +0000 (19:44 +0100)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Fri, 25 Jan 2019 18:44:19 +0000 (19:44 +0100)
pdns/lua-record.cc

index 03e0b5334559b59b4ccc257208eb00680f7a2849..429069e4e2d76baf993facfe6b3fcfcb9b00e4ef 100644 (file)
@@ -896,7 +896,16 @@ std::vector<shared_ptr<DNSRecordContent>> luaSynth(const std::string& code, cons
         ret.push_back(DNSRecordContent::mastermake(qtype, QClass::IN, content ));
     }
   } catch(std::exception &e) {
-    g_log<<Logger::Error<<"Lua record reported: "<<e.what()<<endl;
+    g_log<<Logger::Error<<"Lua record reported: "<<e.what();
+    try {
+      std::rethrow_if_nested(e);
+      g_log<<endl;
+    } catch(const std::exception& ne) {
+      g_log << ": " << ne.what() << std::endl;
+    }
+    catch(const PDNSException& ne) {
+      g_log << ": " << ne.reason << std::endl;
+    }
     throw ;
   }