Binance C++ Connector 2.0.0
Official C++ connectors for the Binance APIs
Loading...
Searching...
No Matches
binance::common::ConnectorError Class Reference

Base class of every error raised while sending a REST request. More...

#include <errors.hpp>

Inheritance diagram for binance::common::ConnectorError:
binance::common::Error binance::common::BadRequestError binance::common::ConflictError binance::common::ConnectorClientError binance::common::ForbiddenError binance::common::NetworkError binance::common::NotFoundError binance::common::RateLimitBanError binance::common::ServerError binance::common::TooManyRequestsError binance::common::UnauthorizedError

Public Member Functions

 ConnectorError (const std::string &what, std::string msg, std::optional< std::int64_t > code=std::nullopt)
const RawResponse * response () const noexcept
 The HTTP response that caused the error, when there was one: status, headers (e.g.
std::optional< std::chrono::seconds > retry_after () const noexcept
 The delay from the Retry-After header of a 418 / 429 response, if it has one.
Public Member Functions inherited from binance::common::Error
 Error (const std::string &what, std::string msg, std::optional< std::int64_t > code=std::nullopt)
const std::string & msg () const noexcept
std::optional< std::int64_t > code () const noexcept

Friends

struct detail::ErrorAccess

Detailed Description

Base class of every error raised while sending a REST request.

Constructor & Destructor Documentation

◆ ConnectorError()

binance::common::ConnectorError::ConnectorError ( const std::string & what,
std::string msg,
std::optional< std::int64_t > code = std::nullopt )

Member Function Documentation

◆ response()

const RawResponse * binance::common::ConnectorError::response ( ) const
inlinenodiscardnoexcept

The HTTP response that caused the error, when there was one: status, headers (e.g.

retry-after on 418 / 429), parsed rate limits and the raw body. nullptr otherwise.

◆ retry_after()

std::optional< std::chrono::seconds > binance::common::ConnectorError::retry_after ( ) const
nodiscardnoexcept

The delay from the Retry-After header of a 418 / 429 response, if it has one.

Only the delay-seconds form is read: an HTTP-date, a negative or a non-numeric value gives nullopt, as does any other error.

◆ detail::ErrorAccess

friend struct detail::ErrorAccess
friend