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

Base class of every error raised by the WebSocket clients. More...

#include <errors.hpp>

Inheritance diagram for binance::common::WebsocketError:
binance::common::Error 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

 WebsocketError (const std::string &what, bool request_sent=false)
 WebsocketError (const std::string &what, std::string msg, std::optional< std::int64_t > code, bool request_sent)
bool request_sent () const noexcept
 True when the request was handed to the connection, so Binance may have executed it and the outcome is unknown.
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

Detailed Description

Base class of every error raised by the WebSocket clients.

As for ConnectorError, what() is the formatted message and msg() the underlying one without the error-kind prefix; errors with no underlying message use what() for both.

Constructor & Destructor Documentation

◆ WebsocketError() [1/2]

binance::common::WebsocketError::WebsocketError ( const std::string & what,
bool request_sent = false )
explicit

◆ WebsocketError() [2/2]

binance::common::WebsocketError::WebsocketError ( const std::string & what,
std::string msg,
std::optional< std::int64_t > code,
bool request_sent )

Member Function Documentation

◆ request_sent()

bool binance::common::WebsocketError::request_sent ( ) const
inlinenodiscardnoexcept

True when the request was handed to the connection, so Binance may have executed it and the outcome is unknown.

For orders, look the order up (e.g. by newClientOrderId) before sending it again.