]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
GSQLBackend: fix logging nits
authorPieter Lexis <pieter.lexis@powerdns.com>
Fri, 15 Mar 2019 13:05:20 +0000 (14:05 +0100)
committerPieter Lexis <pieter.lexis@powerdns.com>
Thu, 21 Mar 2019 09:37:07 +0000 (10:37 +0100)
pdns/backends/gsql/gsqlbackend.cc

index b3af298619c71984d487236bf8700d0c0bb94de9..7d6696d021ca3729181e0f81433b59a6a5d9d7a0 100644 (file)
@@ -350,8 +350,8 @@ void GSQLBackend::getUnfreshSlaveInfos(vector<DomainInfo> *unfreshDomains)
 
     try {
       sd.zone = DNSName(row[1]);
-    } catch(const PDNSException &e) {
-      g_log<<Logger::Warning<<"Domain name '"<<row[1]<<"' is not a valid DNS name: "<<e.reason<<endl;
+    } catch(const std::runtime_error &e) {
+      g_log<<Logger::Warning<<"Domain name '"<<row[1]<<"' is not a valid DNS name: "<<e.what()<<endl;
       continue;
     }
 
@@ -1294,12 +1294,16 @@ void GSQLBackend::getAllDomains(vector<DomainInfo> *domains, bool include_disabl
         continue;
       }
 
-      if (pdns_iequals(row[3], "MASTER"))
+      if (pdns_iequals(row[3], "MASTER")) {
         di.kind = DomainInfo::Master;
-      else if (pdns_iequals(row[3], "SLAVE"))
+      } else if (pdns_iequals(row[3], "SLAVE")) {
         di.kind = DomainInfo::Slave;
-      else
+      } else if (pdns_iequals(row[3], "NATIVE")) {
         di.kind = DomainInfo::Native;
+      } else {
+        g_log<<Logger::Warning<<"Could not parse domain kind '"<<row[3]<<"' as one of 'MASTER', 'SLAVE' or 'NATIVE'. Setting zone kind to 'NATIVE'"<<endl;
+        di.kind = DomainInfo::Native;
+      }
   
       if (!row[4].empty()) {
         vector<string> masters;