]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[478-improve-error-message-database-backend-mysql] Reviewed changes and addressed... 478-improve-error-message-database-backend-mysql
authorFrancis Dupont <fdupont@isc.org>
Wed, 6 Mar 2019 20:24:38 +0000 (21:24 +0100)
committerFrancis Dupont <fdupont@isc.org>
Wed, 6 Mar 2019 20:25:23 +0000 (15:25 -0500)
src/lib/dhcpsrv/host_data_source_factory.cc
src/lib/dhcpsrv/lease_mgr_factory.cc

index f681c9f530e0ebf86c8a62a82842b5ca76a89d65..d6f5ee8ac1764ca721ba7d4f25cc202675b4db6c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2015-2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2015-2019 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -61,10 +61,13 @@ HostDataSourceFactory::add(HostDataSourceList& sources,
 
     // No match?
     if (index == map_.end()) {
-        if ( (db_type == "mysql") || (db_type == "pgsql") || (db_type == "cql")) {
+        if ((db_type == "mysql") ||
+            (db_type == "postgresql") ||
+            (db_type == "cql")) {
+            string with = (db_type == "postgresql" ? "pgsql" : db_type);
             isc_throw(InvalidType, "The type of host backend: '" << db_type
-                      << "' is not compiled in. Did you forget to use --with-mysql,"
-                      << " --with-pgsql or --with-cql during compilation?");
+                      << "' is not compiled in. Did you forget to use --with-"
+                      << with << " during compilation?");
         }
         isc_throw(InvalidType, "The type of host backend: '" <<
                   db_type << "' is not supported");
index 068cfb0e5aa74f2e9f1ffcf468e135fd3be040fb..30269c02c8f8ded90332940df02bc5da57745cc1 100644 (file)
@@ -65,7 +65,7 @@ LeaseMgrFactory::create(const std::string& dbaccess) {
         return;
 #else
         LOG_ERROR(dhcpsrv_logger, DHCPSRV_UNKNOWN_DB).arg("mysql");
-        isc_throw(InvalidType, "The Kea server has not been built with "
+        isc_throw(InvalidType, "The Kea server has not been compiled with "
                   "support for database type: mysql");
 #endif
     }
@@ -77,7 +77,7 @@ LeaseMgrFactory::create(const std::string& dbaccess) {
         return;
 #else
         LOG_ERROR(dhcpsrv_logger, DHCPSRV_UNKNOWN_DB).arg("postgresql");
-        isc_throw(InvalidType, "The Kea server has not been built with "
+        isc_throw(InvalidType, "The Kea server has not been compiled with "
                   "support for database type: postgresql");
 #endif
     }
@@ -88,7 +88,7 @@ LeaseMgrFactory::create(const std::string& dbaccess) {
         return;
 #else
         LOG_ERROR(dhcpsrv_logger, DHCPSRV_UNKNOWN_DB).arg("cql");
-        isc_throw(InvalidType, "The Kea server has not been built with "
+        isc_throw(InvalidType, "The Kea server has not been compiled with "
                   "support for database type: cql");
 #endif
     }