]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2947] Update exception hierarchy
authorMukund Sivaraman <muks@isc.org>
Tue, 18 Jun 2013 10:42:41 +0000 (16:12 +0530)
committerMukund Sivaraman <muks@isc.org>
Thu, 20 Jun 2013 10:01:50 +0000 (15:31 +0530)
Put all the library exceptions under DataSourceLibraryError.

src/lib/datasrc/factory.cc
src/lib/datasrc/factory.h

index 34ab6d8b7484df6cb655ee2c8da7616845401fc5..26b31dd687f5e6c3a76c56ae4e7eb2dffdd70ce0 100644 (file)
@@ -83,8 +83,8 @@ LibraryContainer::LibraryContainer(const std::string& name) {
     if (ds_lib_ == NULL) {
         // This may cause the filename to appear twice in the actual
         // error, but the output of dlerror is implementation-dependent
-        isc_throw(DataSourceLibraryError, "dlopen failed for " << name <<
-                                          ": " << dlerror());
+        isc_throw(DataSourceLibraryOpenError,
+                  "dlopen failed for " << name << ": " << dlerror());
     }
 }
 
index 4e669ec1adc3c4022498e08a31c7a0ad4f9d563c..b9b6578a820a8b2b04549ae95694de836fb21028 100644 (file)
@@ -27,7 +27,7 @@ namespace isc {
 namespace datasrc {
 
 
-/// \brief Raised if there is an error loading the datasource implementation
+/// \brief Raised if there is an error in the datasource implementation
 ///        library
 class DataSourceLibraryError : public DataSourceError {
 public:
@@ -35,13 +35,22 @@ public:
         DataSourceError(file, line, what) {}
 };
 
+/// \brief Raised if there is an error opening the the datasource
+///        implementation library
+class DataSourceLibraryOpenError : public DataSourceLibraryError {
+public:
+    DataSourceLibraryOpenError(const char* file, size_t line,
+                               const char* what) :
+        DataSourceLibraryError(file, line, what) {}
+};
+
 /// \brief Raised if there is an error reading a symbol from the datasource
 ///        implementation library
-class DataSourceLibrarySymbolError : public DataSourceError {
+class DataSourceLibrarySymbolError : public DataSourceLibraryError {
 public:
     DataSourceLibrarySymbolError(const char* file, size_t line,
                                  const char* what) :
-        DataSourceError(file, line, what) {}
+        DataSourceLibraryError(file, line, what) {}
 };
 
 typedef DataSourceClient* ds_creator(isc::data::ConstElementPtr config,