]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2378] Fix ZoneLoader after merge
authorMichal 'vorner' Vaner <michal.vaner@nic.cz>
Thu, 13 Dec 2012 11:02:05 +0000 (12:02 +0100)
committerMichal 'vorner' Vaner <michal.vaner@nic.cz>
Thu, 13 Dec 2012 11:02:05 +0000 (12:02 +0100)
There were some small changes in the behaviour of MasterLoader as a
result of review, this is update do ZoneLoader and its tests to
incorporate that.

src/lib/datasrc/tests/zone_loader_unittest.cc
src/lib/datasrc/zone_loader.cc

index c71c1e3572a06455e6f2ecc6036c664380891c89..b19a843fb9dd76b03397be7632d03bc05c1fad5a 100644 (file)
@@ -327,8 +327,6 @@ TEST_F(ZoneLoaderTest, loadUnsignedIncremental) {
     // Not committed yet, we didn't complete the loading
     EXPECT_FALSE(destination_client_.commit_called_);
 
-    // This is unusual, but allowed. Check it doesn't do anything
-    loader.loadIncremental(0);
     EXPECT_EQ(10, destination_client_.rrsets_.size());
     EXPECT_FALSE(destination_client_.commit_called_);
 
index 5a36b32032cb5f94ad4a9d77574533b084a38a76..01f216e1d4978b974283ca2787ccc58bfad8169c 100644 (file)
@@ -110,7 +110,11 @@ ZoneLoader::loadIncremental(size_t limit) {
 
     if (iterator_ == ZoneIteratorPtr()) {
         assert(loader_.get() != NULL);
-        complete_ = loader_->loadIncremental(limit);
+        try {
+            complete_ = loader_->loadIncremental(limit);
+        } catch (const isc::dns::MasterLoaderError& e) {
+            isc_throw(MasterFileError, e.getMessage().c_str());
+        }
         if (complete_ && !loaded_ok_) {
             isc_throw(MasterFileError, "Error while loading master file");
         }