9#ifndef BOTAN_ASIO_ERROR_H_
10#define BOTAN_ASIO_ERROR_H_
12#include <botan/build.h>
14#include <boost/version.hpp>
15#if BOOST_VERSION >= 106600
17#include <boost/system/system_error.hpp>
19#include <botan/exceptn.h>
20#include <botan/tls_alert.h>
21#include <botan/tls_exceptn.h>
43 const char*
name() const noexcept
override
45 return "Botan TLS Stream";
48 std::string
message(
int value)
const override
53 return "stream truncated";
55 return "generic error";
76 const char*
name() const noexcept
override
78 return "Botan TLS Alert";
81 std::string
message(
int ev)
const override
106 const char*
name() const noexcept
override
137template<>
struct is_error_code_enum<
Botan::TLS::Alert::Type>
139 static const bool value =
true;
142template<>
struct is_error_code_enum<
Botan::TLS::StreamError>
144 static const bool value =
true;
147template<>
struct is_error_code_enum<
Botan::ErrorType>
149 static const bool value =
true;
std::string type_string() const
const StreamCategory & botan_stream_category()
const BotanAlertCategory & botan_alert_category() noexcept
boost::system::error_code make_error_code(Botan::TLS::StreamError e)
const BotanErrorCategory & botan_category() noexcept
std::string to_string(ErrorType type)
Convert an ErrorType to string.
boost::system::error_code make_error_code(Botan::ErrorType e)
An error category for errors from Botan (other than TLS alerts)
virtual ~BotanErrorCategory()=default
std::string message(int ev) const override
const char * name() const noexcept override
An error category for TLS alerts.
std::string message(int ev) const override
const char * name() const noexcept override
virtual ~BotanAlertCategory()=default
An error category for errors from the TLS::Stream.
virtual ~StreamCategory()=default
const char * name() const noexcept override
std::string message(int value) const override