g_log << Logger::Error << "Fatal error: " << A.reason << endl;
exit(1);
}
+ catch (const std::exception& e) {
+ g_log << Logger::Error << "Fatal error: " << e.what() << endl;
+ exit(1);
+ }
try {
declareStats();
}
- catch (PDNSException& PE) {
+ catch (const PDNSException& PE) {
g_log << Logger::Error << "Exiting because: " << PE.reason << endl;
exit(1);
}
try {
mainthread();
}
- catch (PDNSException& e) {
- if (!::arg().mustDo("daemon"))
- cerr << "Exiting because: " << e.reason << endl;
+ catch (const PDNSException& e) {
+ try {
+ if (!::arg().mustDo("daemon")) {
+ cerr << "Exiting because: " << e.reason << endl;
+ }
+ }
+ catch (const ArgException& A) {
+ }
g_log << Logger::Error << "Exiting because: " << e.reason << endl;
}
- catch (std::exception& e) {
- if (!::arg().mustDo("daemon"))
- cerr << "Exiting because of STL error: " << e.what() << endl;
+ catch (const std::exception& e) {
+ try {
+ if (!::arg().mustDo("daemon")) {
+ cerr << "Exiting because of STL error: " << e.what() << endl;
+ }
+ }
+ catch (const ArgException& A) {
+ }
g_log << Logger::Error << "Exiting because of STL error: " << e.what() << endl;
}
catch (...) {
if (rrsig_labels < fqdn_labels) {
DNSName choppedQname(qname);
- while (choppedQname.countLabels() > rrsig_labels)
+ while (choppedQname.countLabels() > rrsig_labels) {
choppedQname.chopOff();
+ }
nameToHash = "\x01*" + choppedQname.toDNSStringLC();
} else if (rrsig_labels > fqdn_labels) {
// The RRSIG Labels field is a lie (or the qname is wrong) and the RRSIG