Botan  2.6.0
Crypto and TLS for C++11
tls_exceptn.h
Go to the documentation of this file.
1 /*
2 * Exceptions
3 * (C) 2004-2006 Jack Lloyd
4 *
5 * Botan is released under the Simplified BSD License (see license.txt)
6 */
7 
8 #ifndef BOTAN_TLS_EXCEPTION_H_
9 #define BOTAN_TLS_EXCEPTION_H_
10 
11 #include <botan/exceptn.h>
12 #include <botan/tls_alert.h>
13 
14 namespace Botan {
15 
16 namespace TLS {
17 
18 /**
19 * Exception Base Class
20 */
22  {
23  public:
24  Alert::Type type() const { return m_alert_type; }
25 
27  const std::string& err_msg = "Unknown error") :
28  Exception(err_msg), m_alert_type(type) {}
29 
30  private:
31  Alert::Type m_alert_type;
32  };
33 
34 /**
35 * Unexpected_Message Exception
36 */
38  {
39  public:
40  explicit Unexpected_Message(const std::string& err) :
41  TLS_Exception(Alert::UNEXPECTED_MESSAGE, err) {}
42  };
43 
44 }
45 
46 }
47 
48 #endif
#define BOTAN_PUBLIC_API(maj, min)
Definition: compiler.h:27
MechanismType type
Unexpected_Message(const std::string &err)
Definition: tls_exceptn.h:40
Definition: alg_id.cpp:13
Alert::Type type() const
Definition: tls_exceptn.h:24
TLS_Exception(Alert::Type type, const std::string &err_msg="Unknown error")
Definition: tls_exceptn.h:26