Botan 1.10.17

tls_exceptn.h
Go to the documentation of this file.
1 /*
2 * Exceptions
3 * (C) 2004-2006 Jack Lloyd
4 *
5 * Released under the terms of the Botan license
6 */
7
8 #ifndef BOTAN_TLS_EXCEPTION_H__
9 #define BOTAN_TLS_EXCEPTION_H__
10
11 #include <botan/exceptn.h>
12 #include <botan/tls_magic.h>
13
14 namespace Botan {
15
16 /**
17 * Exception Base Class
18 */
19 class BOTAN_DLL TLS_Exception : public Exception
20 {
21 public:
22 Alert_Type type() const throw() { return alert_type; }
23
24 TLS_Exception(Alert_Type type,
25 const std::string& err_msg = "Unknown error") :
26 Exception(err_msg), alert_type(type) {}
27
28 private:
29 Alert_Type alert_type;
30 };
31
32 /**
33 * Unexpected_Message Exception
34 */
35 struct BOTAN_DLL Unexpected_Message : public TLS_Exception
36 {
37 Unexpected_Message(const std::string& err) :
38 TLS_Exception(UNEXPECTED_MESSAGE, err) {}
39 };
40
41 }
42
43 #endif
Botan::UNEXPECTED_MESSAGE
Definition: tls_magic.h:64
Botan::TLS_Exception
Definition: tls_exceptn.h:19
Botan::Exception
std::runtime_error Exception
Definition: exceptn.h:19
Botan
Definition: algo_base.h:14
Botan::Alert_Type
Alert_Type
Definition: tls_magic.h:62
Botan::TLS_Exception::type
Alert_Type type() const
Definition: tls_exceptn.h:22
Botan::Unexpected_Message
Definition: tls_exceptn.h:35
Botan::Unexpected_Message::Unexpected_Message
Unexpected_Message(const std::string &err)
Definition: tls_exceptn.h:37
Botan::TLS_Exception::TLS_Exception
TLS_Exception(Alert_Type type, const std::string &err_msg="Unknown error")
Definition: tls_exceptn.h:24