\
RNAME##RecordContent::RNAME##RecordContent(const string& zoneData) : DNSRecordContent(RTYPE) \
{ \
- RecordTextReader rtr(zoneData); \
- xfrPacket(rtr); \
+ try { \
+ RecordTextReader rtr(zoneData); \
+ xfrPacket(rtr); \
+ } \
+ catch(RecordTextException& rtr) { \
+ throw MOADNSParser("Parsing record content: "+string(rtr.what())); \
+ } \
} \
\
string RNAME##RecordContent::getZoneRepresentation() const \
#include "syncres.hh"
#include "dnswriter.hh"
#include "dnsparser.hh"
+#include "logger.hh"
LWRes::LWRes()
{
return ret;
// return p.getAnswers();
}
+ catch(exception &mde) {
+ if(::arg().mustDo("log-common-errors"))
+ L<<Logger::Error<<"Unable to parse packet from remote server: "<<mde.what()<<"\n";
+ }
catch(...) {
- g_stats.serverParseError++;
- d_rcode=RCode::ServFail;
- LWRes::res_t empty;
- return empty;
+ L<<Logger::Error<<"Unknown error parsing packet from remote server"<<endl;
}
+ g_stats.serverParseError++;
+ d_rcode=RCode::ServFail;
+ LWRes::res_t empty;
+ return empty;
}
skipSpaces();
if(!isdigit(d_string.at(d_pos)))
- throw RecordTextException("expected digits at position "+lexical_cast<string>(d_pos)+" in '"+d_string+"'");
+ throw RecordTextException("while parsing IP address, expected digits at position "+lexical_cast<string>(d_pos)+" in '"+d_string+"'");
string ip;
xfrLabel(ip);