19 #include <boost/asio/error.hpp>
20 #include <boost/system/error_code.hpp>
29 namespace diagnostics {
40 if (ec == boost::asio::error::connection_refused) {
43 if (ec == boost::asio::error::timed_out) {
46 if (ec == boost::asio::error::connection_reset) {
49 if (ec == boost::asio::error::connection_aborted) {
52 if (ec == boost::asio::error::network_unreachable || ec == boost::asio::error::host_unreachable) {
55 if (ec == boost::asio::error::already_connected) {
58 if (ec == boost::asio::error::address_in_use) {
61 if (ec == boost::asio::error::access_denied) {
73 if (!ec)
return false;
76 if (ec == boost::asio::error::connection_refused)
return true;
78 if (ec == boost::asio::error::timed_out)
return true;
80 if (ec == boost::asio::error::connection_reset)
return true;
82 if (ec == boost::asio::error::network_unreachable || ec == boost::asio::error::host_unreachable)
return true;
84 if (ec == boost::asio::error::try_again)
return true;
87 if (ec == boost::asio::error::operation_aborted)
return false;
98 std::optional<size_t> client_id = std::nullopt) {
Context for error events.
wrapper::ErrorContext to_error_context(const diagnostics::ErrorInfo &info, std::optional< size_t > client_id=std::nullopt)
Converts ErrorInfo to wrapper::ErrorContext.
bool is_retryable_tcp_connect_error(const boost::system::error_code &ec)
Determines if a TCP connection error is retryable.
ErrorCode to_unilink_error_code(const boost::system::error_code &ec)
Maps boost::system::error_code to Unilink ErrorCode.
wrapper::ErrorContext ErrorContext
ErrorCode
Structured error codes for Unilink.
Comprehensive error information structure.
boost::system::error_code boost_error