/* * Exceptions * (C) 2004-2006 Jack Lloyd * * Botan is released under the Simplified BSD License (see license.txt) */ #ifndef BOTAN_TLS_EXCEPTION_H__ #define BOTAN_TLS_EXCEPTION_H__ #include #include namespace Botan { namespace TLS { /** * Exception Base Class */ class BOTAN_DLL TLS_Exception : public Exception { public: Alert::Type type() const { return m_alert_type; } TLS_Exception(Alert::Type type, const std::string& err_msg = "Unknown error") : Exception(err_msg), m_alert_type(type) {} private: Alert::Type m_alert_type; }; /** * Unexpected_Message Exception */ struct BOTAN_DLL Unexpected_Message : public TLS_Exception { explicit Unexpected_Message(const std::string& err) : TLS_Exception(Alert::UNEXPECTED_MESSAGE, err) {} }; } } #endif