Browse Source

[2378] Consider masterfile errors in ZoneLoader docs

Michal 'vorner' Vaner 12 years ago
parent
commit
a8326a6fca
1 changed files with 15 additions and 0 deletions
  1. 15 0
      src/lib/datasrc/zone_loader.h

+ 15 - 0
src/lib/datasrc/zone_loader.h

@@ -15,6 +15,8 @@
 #ifndef DATASRC_ZONE_LOADER_H
 #define DATASRC_ZONE_LOADER_H
 
+#include <datasrc/data_source.h>
+
 #include <cstdlib> // For size_t
 #include <boost/shared_ptr.hpp>
 
@@ -32,6 +34,17 @@ typedef boost::shared_ptr<ZoneIterator> ZoneIteratorPtr;
 class ZoneUpdater;
 typedef boost::shared_ptr<ZoneUpdater> ZoneUpdaterPtr;
 
+/// \brief Exception thrown when there's a problem with master file.
+///
+/// This is thrown by the ZoneLoader when there's a fatal problem with
+/// a master file being loaded.
+class MasterFileError : public DataSourceError {
+public:
+    MasterFileError(const char* file, size_t line, const char* what) :
+        DataSourceError(file, line, what)
+    {}
+};
+
 /// \brief Class to load data into a data source client.
 ///
 /// This is a small wrapper class that is able to load data into a data source.
@@ -56,6 +69,8 @@ public:
     ///     beforehead.
     /// \throw DataSourceError in case of other (possibly low-level) errors,
     ///     such as read-only data source or database error.
+    /// \throw MasterFileError when the master_file is badly formatted or some
+    ///     similar problem is found when loading the master file.
     ZoneLoader(DataSourceClient& destination, const isc::dns::Name& zone_name,
                const char* master_file);