diff options
Diffstat (limited to 'src/lib/dns/exceptions.h')
-rw-r--r-- | src/lib/dns/exceptions.h | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/src/lib/dns/exceptions.h b/src/lib/dns/exceptions.h index 070b152c2b..21030b49c2 100644 --- a/src/lib/dns/exceptions.h +++ b/src/lib/dns/exceptions.h @@ -30,10 +30,34 @@ namespace dns { /// class Rcode; // forward declaration -class DNSProtocolError : public isc::Exception { +class Exception : public isc::Exception { public: - DNSProtocolError(const char* file, size_t line, const char* what) : + Exception(const char* file, size_t line, const char* what) : isc::Exception(file, line, what) {} +}; + +/// +/// \brief Base class for all sorts of text parse errors. +/// +class DNSTextError : public isc::dns::Exception { +public: + DNSTextError(const char* file, size_t line, const char* what) : + isc::dns::Exception(file, line, what) {} +}; + +/// +/// \brief Base class for name parser exceptions. +/// +class NameParserException : public DNSTextError { +public: + NameParserException(const char* file, size_t line, const char* what) : + DNSTextError(file, line, what) {} +}; + +class DNSProtocolError : public isc::dns::Exception { +public: + DNSProtocolError(const char* file, size_t line, const char* what) : + isc::dns::Exception(file, line, what) {} virtual const Rcode& getRcode() const = 0; }; @@ -50,6 +74,7 @@ public: DNSProtocolError(file, line, what) {} virtual const Rcode& getRcode() const; }; + } } #endif // DNS_EXCEPTIONS_H |