]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
GSQLBackend::*DomainMetadata: log domain and kind in errors
authorPieter Lexis <pieter.lexis@powerdns.com>
Fri, 15 Mar 2019 10:55:44 +0000 (11:55 +0100)
committerPieter Lexis <pieter.lexis@powerdns.com>
Fri, 15 Mar 2019 13:34:46 +0000 (14:34 +0100)
pdns/backends/gsql/gsqlbackend.cc

index c833f025f8518e8e344737d4fad4aca0ec9b9c6c..fc0cf30ccb14dc5eb48432a3cccab75ca0fa730c 100644 (file)
@@ -937,7 +937,7 @@ bool GSQLBackend::getAllDomainMetadata(const DNSName& name, std::map<std::string
     d_GetAllDomainMetadataQuery_stmt->reset();
   }
   catch (SSqlException &e) {
-    throw PDNSException("GSQLBackend unable to list metadata: "+e.txtReason());
+    throw PDNSException("GSQLBackend unable to list metadata for domain '" + name.toLogString() + "': "+e.txtReason());
   }
 
   return true;
@@ -968,7 +968,7 @@ bool GSQLBackend::getDomainMetadata(const DNSName& name, const std::string& kind
     d_GetDomainMetadataQuery_stmt->reset();
   }
   catch (SSqlException &e) {
-    throw PDNSException("GSQLBackend unable to list metadata: "+e.txtReason());
+    throw PDNSException("GSQLBackend unable to get metadata kind '" + kind + "' for domain '" + name.toLogString() + "': "+e.txtReason());
   }
 
   return true;
@@ -999,7 +999,7 @@ bool GSQLBackend::setDomainMetadata(const DNSName& name, const std::string& kind
     }
   }
   catch (SSqlException &e) {
-    throw PDNSException("GSQLBackend unable to store metadata key: "+e.txtReason());
+    throw PDNSException("GSQLBackend unable to set metadata kind '" + kind + "' for domain '" + name.toLogString() + "': "+e.txtReason());
   }
   
   return true;