]> granicus.if.org Git - pdns/commitdiff
deal with out-of-zone errors properly
authorBert Hubert <bert.hubert@netherlabs.nl>
Thu, 8 Mar 2007 09:02:03 +0000 (09:02 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Thu, 8 Mar 2007 09:02:03 +0000 (09:02 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@968 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/backends/bind/bindbackend2.cc

index 059bde909df034a9495d59da2815e80fa28d9bf6..59958cb58416d9dc4ef1cdbda943ebe684f60eea 100644 (file)
@@ -549,6 +549,16 @@ void Bind2Backend::loadConfig(string* status)
            contents.clear();
            //  s_stage->id_zone_map[bbd->d_id].d_records->swap(*s_staging_zone_map[bbd->d_id].d_records);
          }
+         catch(AhuException &ae) {
+           ostringstream msg;
+           msg<<" error at "+nowTime()+" parsing '"<<i->name<<"' from file '"<<i->filename<<"': "<<ae.reason;
+
+           if(status)
+             *status+=msg.str();
+           staging->id_zone_map[bbd->d_id].d_status=msg.str();
+           L<<Logger::Warning<<d_logprefix<<msg.str()<<endl;
+           rejected++;
+         }
          catch(exception &ae) {
            ostringstream msg;
            msg<<" error at "+nowTime()+" parsing '"<<i->name<<"' from file '"<<i->filename<<"': "<<ae.what();
@@ -662,6 +672,11 @@ void Bind2Backend::queueReload(BB2DomainInfo *bbd)
     bbd->d_status="parsed into memory at "+nowTime();
     L<<Logger::Warning<<"Zone '"<<bbd->d_name<<"' ("<<bbd->d_filename<<") reloaded"<<endl;
   }
+  catch(AhuException &ae) {
+    ostringstream msg;
+    msg<<" error at "+nowTime()+" parsing '"<<bbd->d_name<<"' from file '"<<bbd->d_filename<<"': "<<ae.reason;
+    bbd->d_status=msg.str();
+  }
   catch(exception &ae) {
     ostringstream msg;
     msg<<" error at "+nowTime()+" parsing '"<<bbd->d_name<<"' from file '"<<bbd->d_filename<<"': "<<ae.what();