Skip to content

Instantly share code, notes, and snippets.

@Habbie
Created April 26, 2013 11:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Habbie/5466833 to your computer and use it in GitHub Desktop.
Save Habbie/5466833 to your computer and use it in GitHub Desktop.
Index: pdns/dnsbackend.cc
===================================================================
--- pdns/dnsbackend.cc (revision 2983)
+++ pdns/dnsbackend.cc (working copy)
@@ -182,7 +182,13 @@
ret.push_back(made);
}
}
- catch(...) {
+ catch(AhuException &ae) {
+ L<<Logger::Error<<"Caught an exception instantiating a backend: "<<ae.reason<<endl;
+ L<<Logger::Error<<"Cleaning up"<<endl;
+ for(vector<DNSBackend *>::const_iterator i=ret.begin();i!=ret.end();++i)
+ delete *i;
+ throw;
+ } catch(...) {
// and cleanup
L<<Logger::Error<<"Caught an exception instantiating a backend, cleaning up"<<endl;
for(vector<DNSBackend *>::const_iterator i=ret.begin();i!=ret.end();++i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment