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

Base class of every error raised by the SDK, so that catch (const common::Error&) handles them all. More...

#include <errors.hpp>

Inheritance diagram for binance::common::Error:
binance::common::ConfigError binance::common::ConnectorError binance::common::WebsocketError 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 binance::common::WebsocketCancelledError binance::common::WebsocketHandshakeError binance::common::WebsocketNetworkError binance::common::WebsocketNoResponseError binance::common::WebsocketNotConnectedError binance::common::WebsocketProtocolError binance::common::WebsocketResponseError binance::common::WebsocketServerError binance::common::WebsocketTimeoutError

Public Member Functions

 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

Detailed Description

Base class of every error raised by the SDK, so that catch (const common::Error&) handles them all.

what() returns the formatted, human readable message; msg() and code() give the raw server (or client) message and the Binance error code, when one was returned.

Constructor & Destructor Documentation

◆ Error()

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

Member Function Documentation

◆ msg()

const std::string & binance::common::Error::msg ( ) const
inlinenodiscardnoexcept

◆ code()

std::optional< std::int64_t > binance::common::Error::code ( ) const
inlinenodiscardnoexcept