}
}
}
+ theL()<<Logger::Warning<<"Loading RPZ from file '"<<fname<<"'"<<endl;
loadRPZFromFile(fname, lci.dfe, polName, defpol, 0);
+ theL()<<Logger::Warning<<"Done loading RPZ from file '"<<fname<<"'"<<endl;
}
catch(std::exception& e) {
theL()<<Logger::Error<<"Unable to load RPZ zone from '"<<fname<<"': "<<e.what()<<endl;
return sr;
}
+// this function is silent - you do the logging
int loadRPZFromFile(const std::string& fname, DNSFilterEngine& target, const std::string& polName, boost::optional<DNSFilterEngine::Policy> defpol, int place)
{
ZoneParserTNG zpt(fname);
DNSRecord dr(drr);
if(dr.d_type == QType::SOA) {
domain = dr.d_name;
-// cerr<<"Origin is "<<domain<<endl;
}
else if(dr.d_type == QType::NS) {
continue;
}
}
catch(PDNSException& pe) {
- cerr<<"Issue parsing '"<<drr.qname<<"' '"<<drr.content<<"' at "<<zpt.getLineOfFile()<<endl;
- cerr<<pe.reason<<endl;
+ throw PDNSException("Issue parsing '"+drr.qname.toString()+"' '"+drr.content+"' at "+zpt.getLineOfFile()+": "+pe.reason);
}
}