]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
bug #1627: Generate better error messages when origin is not specified
authorMukund Sivaraman <muks@isc.org>
Mon, 26 Mar 2012 12:03:25 +0000 (17:33 +0530)
committerMukund Sivaraman <muks@isc.org>
Fri, 30 Mar 2012 09:13:29 +0000 (14:43 +0530)
src/bin/auth/auth_config.cc

index 2ae520c666536d14c78d739909be1de176016af4..f94196a515961dbc20066e30ad8cb8727923c841 100644 (file)
@@ -163,9 +163,16 @@ MemoryDatasourceConfig::build(ConstElementPtr config_value) {
             isc_throw(AuthConfigError, "Missing zone file for zone: "
                       << origin->str());
         }
-        boost::shared_ptr<InMemoryZoneFinder> zone_finder(new
-                                                   InMemoryZoneFinder(rrclass_,
-            Name(origin->stringValue())));
+
+       InMemoryZoneFinder *imzf = NULL;
+       try {
+           imzf = new InMemoryZoneFinder(rrclass_, Name(origin->stringValue()));
+       } catch (const isc::dns::NameParserException& ex) {
+           isc_throw(AuthConfigError, "Error parsing zone's origin: " <<
+                     ex.what());
+       }
+
+       boost::shared_ptr<InMemoryZoneFinder> zone_finder(imzf);
         const result::Result result = memory_client_->addZone(zone_finder);
         if (result == result::EXIST) {
             isc_throw(AuthConfigError, "zone "<< origin->str()