11 #if !defined(RESTINIO_USE_BOOST_ASIO) 18 #define RESTINIO_ASIO_VERSION ASIO_VERSION 29 return ec == asio_ns::error::operation_aborted;
35 return ec == asio_ns::error::eof;
50 #define RESTINIO_ERROR_CATEGORY_NAME_NOEXCEPT ASIO_ERROR_CATEGORY_NOEXCEPT 54 #if defined(ASIO_HAS_WINDOWS_OVERLAPPED_PTR) 56 #define RESTINIO_ASIO_HAS_WINDOWS_OVERLAPPED_PTR 62 #include <boost/asio.hpp> 66 #define RESTINIO_ASIO_VERSION BOOST_ASIO_VERSION 73 using namespace ::boost::asio;
74 using error_code = ::boost::system::error_code;
79 inline bool error_is_operation_aborted(
const asio_ns::error_code & ec )
81 return ec == asio_ns::error::basic_errors::operation_aborted;
84 inline bool error_is_eof(
const asio_ns::error_code & ec )
86 return ec == asio_ns::error::misc_errors::eof;
92 constexpr auto eof = asio_ns::error::misc_errors::eof;
94 inline const auto & system_category() {
return ::boost::system::system_category(); }
99 using error_category_base_t = ::boost::system::error_category;
102 #define RESTINIO_ERROR_CATEGORY_NAME_NOEXCEPT BOOST_SYSTEM_NOEXCEPT 106 #if defined(BOOST_ASIO_HAS_WINDOWS_OVERLAPPED_PTR) 108 #define RESTINIO_ASIO_HAS_WINDOWS_OVERLAPPED_PTR 176 "write group destroyed without external notificato invokation" );
180 "a call to async_write() failed" );
184 "a call to async_read_some_at_call_failed() failed" );
212 return asio_ns::error_code{
static_cast<
int >( err ), restinio_err_category() };
bool error_is_eof(const asio_ns::error_code &ec) noexcept
#define RESTINIO_ASIO_VERSION
After write notificator error: a notificator was set for a write_group_t but no external invokation h...
After write notificator error: data was not sent, connection closed (or aborted) before a given piece...
std::enable_if< std::is_same< Parameter_Container, query_string_params_t >::value||std::is_same< Parameter_Container, router::route_params_t >::value, std::optional< Value_Type > >::type opt_value(const Parameter_Container ¶ms, string_view_t key)
Gets the value of a parameter specified by key wrapped in std::optional<Value_Type> if parameter exis...
bool error_is_operation_aborted(const asio_ns::error_code &ec) noexcept
asio_convertible_error_t
Enum for restinio errors that must presented as asio_ns::error_code value.
virtual std::string message(int value) const override
const auto & system_category()
virtual const char * name() const RESTINIO_ERROR_CATEGORY_NAME_NOEXCEPT override
A call to async_write failed. The corresponding write operation wasn't done.
#define RESTINIO_ERROR_CATEGORY_NAME_NOEXCEPT
asio_ns::error_code make_asio_compaible_error(asio_convertible_error_t err) noexcept
Make restinio error_code compatible with asio_ns::error_code.
const error_category_base_t & restinio_err_category()
Get restinio error category.
A call to async_read_some_at failed. The corresponding sendfile operation wasn't done.