]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2421] Catch ZoneValidationException at a higher level
authorMukund Sivaraman <muks@isc.org>
Wed, 14 Nov 2012 07:48:26 +0000 (13:18 +0530)
committerMukund Sivaraman <muks@isc.org>
Wed, 14 Nov 2012 07:48:26 +0000 (13:18 +0530)
Also split the iterator vs. file log message ids, so that they
are used only in one place each.

src/lib/datasrc/client_list.cc
src/lib/datasrc/datasrc_messages.mes

index 19ec3c36fb1151d6b4cfad270e923fee26c5fa07..e852a5f837b9263f7068224558942ba5f65c1b68 100644 (file)
@@ -14,6 +14,7 @@
 
 
 #include "client_list.h"
+#include "exceptions.h"
 #include "client.h"
 #include "factory.h"
 #include "memory/memory_client.h"
@@ -180,14 +181,8 @@ ConfigurableClientList::configure(const ConstElementPtr& config,
                         } catch (const isc::dns::MasterLoadError& mle) {
                             LOG_ERROR(logger, DATASRC_MASTERLOAD_ERROR)
                                 .arg(mle.what());
-                        } catch (const ZoneDataUpdater::NullRRset& e) {
-                            LOG_ERROR(logger, DATASRC_LOAD_NULL_RRSET_ERROR)
-                                .arg(e.what());
-                        } catch (const ZoneDataUpdater::AddError& e) {
-                            LOG_ERROR(logger, DATASRC_LOAD_ADD_ERROR)
-                                .arg(e.what());
-                        } catch (const isc::datasrc::memory::EmptyZone& e) {
-                            LOG_ERROR(logger, DATASRC_LOAD_EMPTY_ZONE_ERROR)
+                        } catch (const ZoneValidationException& e) {
+                            LOG_ERROR(logger, DATASRC_LOAD_FROM_FILE_ERROR)
                                 .arg(e.what());
                         }
                     } else {
@@ -205,17 +200,8 @@ ConfigurableClientList::configure(const ConstElementPtr& config,
                         }
                         try {
                             cache->load(origin, *iterator);
-                        } catch (const isc::dns::MasterLoadError& mle) {
-                            LOG_ERROR(logger, DATASRC_MASTERLOAD_ERROR)
-                                .arg(mle.what());
-                        } catch (const ZoneDataUpdater::NullRRset& e) {
-                            LOG_ERROR(logger, DATASRC_LOAD_NULL_RRSET_ERROR)
-                                .arg(e.what());
-                        } catch (const ZoneDataUpdater::AddError& e) {
-                            LOG_ERROR(logger, DATASRC_LOAD_ADD_ERROR)
-                                .arg(e.what());
-                        } catch (const isc::datasrc::memory::EmptyZone& e) {
-                            LOG_ERROR(logger, DATASRC_LOAD_EMPTY_ZONE_ERROR)
+                        } catch (const ZoneValidationException& e) {
+                            LOG_ERROR(logger, DATASRC_LOAD_FROM_ITERATOR_ERROR)
                                 .arg(e.what());
                         }
                     }
index 3788a48557e6ca9b8ca047fb08eecafbe2439e12..bcf11c8ff260a1d30ea7c00725bf9148a5d85c27 100644 (file)
@@ -310,20 +310,15 @@ An error was found in the zone data for a MasterFiles zone. The zone
 is not loaded. The specific error is shown in the message, and should
 be addressed.
 
-% DATASRC_LOAD_ADD_ERROR %1
-An error was found in the zone data when it was being loaded. The zone
-was not loaded. The specific error is shown in the message, and should
-be addressed.
-
-% DATASRC_LOAD_NULL_RRSET_ERROR %1
-A NULL RRset was passed to be added to a zone. The zone was not
-loaded. The specific error is shown in the message, and should be
-addressed.
-
-% DATASRC_LOAD_EMPTY_ZONE_ERROR %1
-A zone was asked to be loaded without any zone data. The zone was not
-loaded. The specific error is shown in the message, and should be
-addressed.
+% DATASRC_LOAD_FROM_FILE_ERROR %1
+An error was found in the zone data when it was being loaded from a
+file. The zone was not loaded. The specific error is shown in the
+message, and should be addressed.
+
+% DATASRC_LOAD_FROM_ITERATOR_ERROR %1
+An error was found in the zone data when it was being loaded from an
+iterator. The zone was not loaded. The specific error is shown in the
+message, and should be addressed.
 
 % DATASRC_MEM_ADD_RRSET adding RRset '%1/%2' into zone '%3'
 Debug information. An RRset is being added to the in-memory data source.