BIND 10 trac2435, updated. 2f7f7b1e0fb86c93c17b04489ab7e836a59fe622 [2435] Move RRsetCollectionBase::FindError out of the class and rename it

BIND 10 source code commits bind10-changes at lists.isc.org
Fri Jan 11 13:51:29 UTC 2013


The branch, trac2435 has been updated
       via  2f7f7b1e0fb86c93c17b04489ab7e836a59fe622 (commit)
      from  9bc254508724e55db2ce9624a0a9322f4d3d9f31 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 2f7f7b1e0fb86c93c17b04489ab7e836a59fe622
Author: Mukund Sivaraman <muks at isc.org>
Date:   Fri Jan 11 17:16:38 2013 +0530

    [2435] Move RRsetCollectionBase::FindError out of the class and rename it

-----------------------------------------------------------------------

Summary of changes:
 src/lib/datasrc/database.cc                |    8 +++++---
 src/lib/datasrc/tests/database_unittest.cc |    2 +-
 src/lib/dns/rrset_collection_base.h        |   27 ++++++++++++++-------------
 3 files changed, 20 insertions(+), 17 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/datasrc/database.cc b/src/lib/datasrc/database.cc
index 928f376..bfa029c 100644
--- a/src/lib/datasrc/database.cc
+++ b/src/lib/datasrc/database.cc
@@ -1397,7 +1397,8 @@ public:
     /// given \c name, \c rrclass and \c rrtype.  If no matching RRset
     /// is found, \c NULL is returned.
     ///
-    /// \throw FindError if find() results in some underlying datasrc error.
+    /// \throw isc::dns::RRsetCollectionError if find() results in some
+    /// underlying datasrc error.
     /// \param name The name of the RRset to search for.
     /// \param rrclass The class of the RRset to search for.
     /// \param rrtype The type of the RRset to search for.
@@ -1435,8 +1436,9 @@ public:
             // instead of propagating the exception.
             return (ConstRRsetPtr());
         } catch (const DataSourceError& e) {
-            isc_throw(FindError, "ZoneFinder threw a DataSourceError: " <<
-                      e.getMessage().c_str());
+            isc_throw(RRsetCollectionError,
+                      "ZoneFinder threw a DataSourceError: "
+                          << e.getMessage().c_str());
         }
     }
 
diff --git a/src/lib/datasrc/tests/database_unittest.cc b/src/lib/datasrc/tests/database_unittest.cc
index b7fdf8b..06c399f 100644
--- a/src/lib/datasrc/tests/database_unittest.cc
+++ b/src/lib/datasrc/tests/database_unittest.cc
@@ -4288,7 +4288,7 @@ TEST_F(MockRRsetCollectionTest, findError) {
     EXPECT_THROW({
         this->collection->find(Name("dsexception.example.org"), this->qclass_,
                                RRType::A());
-    }, RRsetCollectionBase::FindError);
+    }, RRsetCollectionError);
 }
 
 }
diff --git a/src/lib/dns/rrset_collection_base.h b/src/lib/dns/rrset_collection_base.h
index 461ce8b..a368b40 100644
--- a/src/lib/dns/rrset_collection_base.h
+++ b/src/lib/dns/rrset_collection_base.h
@@ -25,6 +25,19 @@
 namespace isc {
 namespace dns {
 
+/// \brief Error during RRsetCollectionBase find() operation
+///
+/// This exception is thrown when an calling implementation of
+/// \c RRsetCollectionBase::find() results in an error which is not due
+/// to unmatched data, but because of some other underlying error
+/// condition.
+class RRsetCollectionError : public Exception {
+public:
+    RRsetCollectionError(const char* file, size_t line, const char* what) :
+        Exception(file, line, what)
+    {}
+};
+
 /// \brief Generic class to represent a set of RRsets.
 ///
 /// This is a generic container and the stored set of RRsets does not
@@ -38,18 +51,6 @@ namespace dns {
 /// STL container. libdatasrc will have another implementation.
 class RRsetCollectionBase {
 public:
-    /// \brief Error during find operation
-    ///
-    /// This exception is thrown when an calling implementation of
-    /// \c find() results in an error which is not due to unmatched
-    /// data, but because of some other underlying error condition.
-    class FindError : public Exception {
-    public:
-        FindError(const char* file, size_t line, const char* what) :
-            Exception(file, line, what)
-        {}
-    };
-
     /// \brief Find a matching RRset in the collection.
     ///
     /// Returns the RRset in the collection that exactly matches the
@@ -59,7 +60,7 @@ public:
     /// This method's implementations currently are not specified to
     /// handle \c RRTypes such as RRSIG, NSEC3, ANY, or AXFR.
     ///
-    /// \throw FindError if find() results in some
+    /// \throw RRsetCollectionError if find() results in some
     /// implementation-specific error.
     /// \param name The name of the RRset to search for.
     /// \param rrtype The type of the RRset to search for.



More information about the bind10-changes mailing list