aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/exception.cpp39
-rw-r--r--vmime/exception.hpp41
2 files changed, 54 insertions, 26 deletions
diff --git a/src/exception.cpp b/src/exception.cpp
index bc599c76..9cfd2201 100644
--- a/src/exception.cpp
+++ b/src/exception.cpp
@@ -677,6 +677,30 @@ const char* file_not_found::name() const throw() { return "file_not_found"; }
#endif // VMIME_HAVE_FILESYSTEM_FEATURES
+//
+// authentication_exception
+//
+
+authentication_exception::~authentication_exception() throw() {}
+authentication_exception::authentication_exception(const string& what, const exception& other)
+ : exception(what, other) {}
+
+exception* authentication_exception::clone() const { return new authentication_exception(*this); }
+const char* authentication_exception::name() const throw() { return "authentication_exception"; }
+
+
+//
+// no_auth_information
+//
+
+no_auth_information::~no_auth_information() throw() {}
+no_auth_information::no_auth_information(const exception& other)
+ : authentication_exception("Information cannot be provided.", other) {}
+
+exception* no_auth_information::clone() const { return new no_auth_information(*this); }
+const char* no_auth_information::name() const throw() { return "no_auth_information"; }
+
+
#if VMIME_HAVE_SASL_SUPPORT
@@ -686,7 +710,7 @@ const char* file_not_found::name() const throw() { return "file_not_found"; }
sasl_exception::~sasl_exception() throw() {}
sasl_exception::sasl_exception(const string& what, const exception& other)
- : exception(what, other) {}
+ : authentication_exception(what, other) {}
exception* sasl_exception::clone() const { return new sasl_exception(*this); }
const char* sasl_exception::name() const throw() { return "sasl_exception"; }
@@ -704,18 +728,6 @@ exception* no_such_mechanism::clone() const { return new no_such_mechanism(*this
const char* no_such_mechanism::name() const throw() { return "no_such_mechanism"; }
-//
-// no_auth_information
-//
-
-no_auth_information::~no_auth_information() throw() {}
-no_auth_information::no_auth_information(const exception& other)
- : sasl_exception("Information cannot be provided.", other) {}
-
-exception* no_auth_information::clone() const { return new no_auth_information(*this); }
-const char* no_auth_information::name() const throw() { return "no_auth_information"; }
-
-
#endif // VMIME_HAVE_SASL_SUPPORT
@@ -777,3 +789,4 @@ const char* unsupported_certificate_type::name() const throw() { return "unsuppo
} // vmime
+
diff --git a/vmime/exception.hpp b/vmime/exception.hpp
index 451fcfc8..04aa9d5a 100644
--- a/vmime/exception.hpp
+++ b/vmime/exception.hpp
@@ -819,48 +819,63 @@ public:
#endif // VMIME_HAVE_FILESYSTEM_FEATURES
-#if VMIME_HAVE_SASL_SUPPORT
+/** Authentication exception.
+ */
+class authentication_exception : public vmime::exception
+{
+public:
-/** Base class for exceptions thrown by SASL module.
+ authentication_exception(const string& what, const exception& other = NO_EXCEPTION);
+ ~authentication_exception() throw();
+
+ exception* clone() const;
+ const char* name() const throw();
+};
+
+
+/** The requested information cannot be provided.
*/
-class sasl_exception : public vmime::exception
+class no_auth_information : public authentication_exception
{
public:
- sasl_exception(const string& what, const exception& other = NO_EXCEPTION);
- ~sasl_exception() throw();
+ no_auth_information(const exception& other = NO_EXCEPTION);
+ ~no_auth_information() throw();
exception* clone() const;
const char* name() const throw();
};
-/** No mechanism is registered with the specified name.
+#if VMIME_HAVE_SASL_SUPPORT
+
+
+/** Base class for exceptions thrown by SASL module.
*/
-class no_such_mechanism : public sasl_exception
+class sasl_exception : public authentication_exception
{
public:
- no_such_mechanism(const string& name, const exception& other = NO_EXCEPTION);
- ~no_such_mechanism() throw();
+ sasl_exception(const string& what, const exception& other = NO_EXCEPTION);
+ ~sasl_exception() throw();
exception* clone() const;
const char* name() const throw();
};
-/** The requested information cannot be provided.
+/** No mechanism is registered with the specified name.
*/
-class no_auth_information : public sasl_exception
+class no_such_mechanism : public sasl_exception
{
public:
- no_auth_information(const exception& other = NO_EXCEPTION);
- ~no_auth_information() throw();
+ no_such_mechanism(const string& name, const exception& other = NO_EXCEPTION);
+ ~no_such_mechanism() throw();
exception* clone() const;
const char* name() const throw();