9#ifndef BOTAN_ASIO_ERROR_H_
10#define BOTAN_ASIO_ERROR_H_
12#include <botan/types.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>
39 const char*
name() const noexcept
override {
return "Botan TLS Stream"; }
41 std::string
message(
int value)
const override {
43 return "stream truncated";
45 return "generic error";
63 const char*
name() const noexcept
override {
return "Botan TLS Alert"; }
65 std::string
message(
int ev)
const override {
86 const char*
name() const noexcept
override {
return "Botan"; }
109struct is_error_code_enum<
Botan::TLS::Alert::Type> {
110 static const bool value =
true;
114struct is_error_code_enum<
Botan::TLS::StreamError> {
115 static const bool value =
true;
119struct is_error_code_enum<
Botan::ErrorType> {
120 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