]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Merge pull request #6152 from zeha/bb2-note-error
authorPieter Lexis <pieterlexis@users.noreply.github.com>
Thu, 25 Jan 2018 11:46:47 +0000 (12:46 +0100)
committerGitHub <noreply@github.com>
Thu, 25 Jan 2018 11:46:47 +0000 (12:46 +0100)
bindbackend: handle std::exception during startup zone-parsing

modules/bindbackend/bindbackend2.cc

index 86159c424d907cc984043c9186e25c2165ac8b07..ff645ad750ab12ef15f248985dea26ec3bff08e6 100644 (file)
@@ -882,6 +882,17 @@ 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;
+            rejected++;
+          }
          safePutBBDomainInfo(bbd);
          
         }