]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
bindbackend: handle std::exception during startup zone-parsing
authorChris Hofstaedtler <chris.hofstaedtler@deduktiva.com>
Fri, 5 Jan 2018 21:17:49 +0000 (22:17 +0100)
committerChris Hofstaedtler <chris.hofstaedtler@deduktiva.com>
Fri, 5 Jan 2018 21:17:49 +0000 (22:17 +0100)
modules/bindbackend/bindbackend2.cc

index 86159c424d907cc984043c9186e25c2165ac8b07..c3b9c8c0164e2ddc7e0b6cbc8a77741a6852a232 100644 (file)
@@ -882,6 +882,18 @@ void Bind2Backend::loadConfig(string* status)
             L<<Logger::Warning<<d_logprefix<<msg.str()<<endl;
             rejected++;
           }
+          catch(std::exception &ae) {
+            ostringstream msg;
+            msg<<" error at "+nowTime()+" parsing '"<<i->name<<"' from file '"<<i->filename<<"': "<<ae.what();
+
+            if(status)
+              *status+=msg.str();
+            bbd.d_status=msg.str();
+
+            L<<Logger::Warning<<d_logprefix<<msg.str()<<endl;
+            cerr << msg.str() << endl;
+            rejected++;
+          }
          safePutBBDomainInfo(bbd);
          
         }