ret.reserve(d_instances.size());
+ std::string current; // to make the exception text more useful
+
try {
for (const auto& instance : d_instances) {
+ current = instance.first + instance.second;
DNSBackend *made = nullptr;
if (metadataOnly) {
}
}
catch(const PDNSException &ae) {
- g_log<<Logger::Error<<"Caught an exception instantiating a backend: "<<ae.reason<<endl;
+ g_log<<Logger::Error<<"Caught an exception instantiating a backend (" << current << "): "<<ae.reason<<endl;
g_log<<Logger::Error<<"Cleaning up"<<endl;
for (auto i : ret) {
delete i;
throw;
} catch(...) {
// and cleanup
- g_log<<Logger::Error<<"Caught an exception instantiating a backend, cleaning up"<<endl;
+ g_log<<Logger::Error<<"Caught an exception instantiating a backend (" << current <<"), cleaning up"<<endl;
for (auto i : ret) {
delete i;
}