#include <fcntl.h>
#include <sstream>
#include <boost/algorithm/string.hpp>
+#include <system_error>
#include "pdns/dnsseckeeper.hh"
#include "pdns/dnssecinfra.hh"
}
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;
L<<Logger::Warning<<d_logprefix<<msg.str()<<endl;
rejected++;
}
- catch(std::exception &ae) {
+ catch(std::system_error &ae) {
ostringstream msg;
- msg<<" error at "+nowTime()+" parsing '"<<i->name<<"' from file '"<<i->filename<<"': "<<ae.what();
+ if (ae.code().value() == ENOENT && isNew && i->type == "slave")
+ msg<<" error at "+nowTime()<<" no file found for new slave domain '"<<i->name<<"'. Has not been AXFR'd yet";
+ else
+ msg<<" error at "+nowTime()+" parsing '"<<i->name<<"' from file '"<<i->filename<<"': "<<ae.what();
if(status)
*status+=msg.str();
#include "zoneparser-tng.hh"
#include <deque>
#include <boost/algorithm/string.hpp>
+#include <system_error>
static string g_INstr("IN");
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);