]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2268] Move EmptyZone exception to InMemoryClient class
authorMukund Sivaraman <muks@isc.org>
Sun, 7 Oct 2012 15:48:38 +0000 (21:18 +0530)
committerMukund Sivaraman <muks@isc.org>
Sun, 7 Oct 2012 15:48:38 +0000 (21:18 +0530)
src/lib/datasrc/memory/memory_client.cc
src/lib/datasrc/memory/memory_client.h
src/lib/datasrc/memory/zone_data_updater.h
src/lib/datasrc/tests/memory/memory_client_unittest.cc

index de1b91d5f283d977bc63c6610c17644a61896282..8f444b610d21cdc6b190129292c0f4faf20a28aa 100644 (file)
@@ -92,7 +92,7 @@ InMemoryClient::load(const Name& zone_name,
     // an SOA RR. This condition should be avoided, and hence load()
     // should throw when an empty zone is loaded.
     if (RdataSet::find(set, RRType::SOA()) == NULL) {
-        isc_throw(ZoneDataUpdater::EmptyZone,
+        isc_throw(EmptyZone,
                   "Won't create an empty zone for: " << zone_name);
     }
 
index 262cbb7909d6cd686d2d3318f84eee80beaf045b..edd3837b6f5da277529dcce457f91ccaf2745b69 100644 (file)
@@ -87,6 +87,16 @@ public:
     /// \return The number of zones stored in the client.
     virtual unsigned int getZoneCount() const;
 
+    /// \brief Zone is empty exception.
+    ///
+    /// This is thrown if we have an empty zone created as a result of
+    /// load().
+    struct EmptyZone : public InvalidParameter {
+        EmptyZone(const char* file, size_t line, const char* what) :
+            InvalidParameter(file, line, what)
+        {}
+    };
+
     /// \brief Load zone from masterfile.
     ///
     /// This loads data from masterfile specified by filename. It replaces
index 1c00aef89812c8ca5572075ca9bc0e41576f48b1..b17a5341fc91983f194ee1c549d5920aa6bfdf5d 100644 (file)
@@ -57,16 +57,6 @@ public:
         {}
     };
 
-    /// \brief Zone is empty exception.
-    ///
-    /// This is thrown if we have an empty zone created as a result of
-    /// load().
-    struct EmptyZone : public InvalidParameter {
-        EmptyZone(const char* file, size_t line, const char* what) :
-            InvalidParameter(file, line, what)
-        {}
-    };
-
     /// \brief General failure exception for \c add().
     ///
     /// This is thrown against general error cases in adding an RRset
index c078105b6e003f9dab0e9fac0ada6ae966216b1f..2bc9304dd520f583d52756693370b279097fd5d1 100644 (file)
@@ -189,7 +189,7 @@ TEST_F(MemoryClientTest, loadEmptyZoneFileThrows) {
 
     EXPECT_THROW(client_->load(Name("."),
                                TEST_DATA_DIR "/empty.zone"),
-                 ZoneDataUpdater::EmptyZone);
+                 InMemoryClient::EmptyZone);
 
     EXPECT_EQ(0, client_->getZoneCount());