From: Pieter Lexis Date: Wed, 16 Dec 2015 16:18:10 +0000 (+0100) Subject: Better error message for unfound new slave domains X-Git-Tag: rec-4.0.0~9^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F3051%2Fhead;p=thirdparty%2Fpdns.git Better error message for unfound new slave domains Closes #2405 --- diff --git a/modules/bindbackend/bindbackend2.cc b/modules/bindbackend/bindbackend2.cc index d961d150a7..7a021743ea 100644 --- a/modules/bindbackend/bindbackend2.cc +++ b/modules/bindbackend/bindbackend2.cc @@ -33,6 +33,7 @@ #include #include #include +#include #include "pdns/dnsseckeeper.hh" #include "pdns/dnssecinfra.hh" @@ -815,8 +816,10 @@ void Bind2Backend::loadConfig(string* status) } BB2DomainInfo bbd; + bool isNew = false; if(!safeGetBBDomainInfo(i->name, &bbd)) { + isNew = true; bbd.d_id=domain_id++; bbd.setCheckInterval(getArgAsNum("check-interval")); bbd.d_lastnotified=0; @@ -848,9 +851,12 @@ void Bind2Backend::loadConfig(string* status) L<name<<"' from file '"<filename<<"': "<type == "slave") + msg<<" error at "+nowTime()<<" no file found for new slave domain '"<name<<"'. Has not been AXFR'd yet"; + else + msg<<" error at "+nowTime()+" parsing '"<name<<"' from file '"<filename<<"': "< #include +#include static string g_INstr("IN"); @@ -57,8 +58,10 @@ ZoneParserTNG::ZoneParserTNG(const vector zonedata, const DNSName& zname void ZoneParserTNG::stackFile(const std::string& fname) { FILE *fp=fopen(fname.c_str(), "r"); - if(!fp) - throw runtime_error("Unable to open file '"+fname+"': "+stringerror()); + if(!fp) { + std::error_code ec (errno,std::generic_category()); + throw std::system_error(ec, "Unable to open file '"+fname+"': "+stringerror()); + } filestate fs(fp, fname); d_filestates.push(fs);