algotradelib 0.0.0.9000
C++ header-only library for algorithmic trading
Loading...
Searching...
No Matches
algotradelib::BrokerError Struct Reference

The error a broker or transport operation returns. More...

#include <algotradelib/src/core/types.hpp>

Public Attributes

ErrorCategory category_ {ErrorCategory::PROTOCOL}
 The kind of failure; the field to branch on.
bool reached_broker_ {true}
 Whether a request was sent before this error.
int http_status_ {0}
 The HTTP status of the reply: set for an HTTP error and for a reply whose body is not a JSON object. 0 if no reply arrived, and on some errors built from a reply that did parse (a declared failure, a missing field) that do not carry it.
std::string broker_code_
 The broker's own error code, verbatim (for example KIS's EGW00201).
std::string request_id_
 The broker's request id for this call, if it gave one.
std::string message_
 A human-readable description, for logs; do not parse it.
std::optional< std::chrono::seconds > retry_after_
 How long the broker asked the caller to wait (Retry-After), for a rate-limit error.
std::optional< int > rate_limit_
 The rate limit the broker says it enforces, in requests per second, for a rate-limit error.

Detailed Description

The error a broker or transport operation returns.

Branch on category_; the other fields are for diagnosis and logs.

Definition at line 742 of file types.hpp.

Member Data Documentation

◆ broker_code_

◆ category_

◆ http_status_

int algotradelib::BrokerError::http_status_ {0}

The HTTP status of the reply: set for an HTTP error and for a reply whose body is not a JSON object. 0 if no reply arrived, and on some errors built from a reply that did parse (a declared failure, a missing field) that do not carry it.

Definition at line 759 of file types.hpp.

Referenced by algotradelib::kiwoom::kiwoom_recognized_refusal(), and algotradelib::runner::outcome_of().

◆ message_

◆ rate_limit_

std::optional<int> algotradelib::BrokerError::rate_limit_

The rate limit the broker says it enforces, in requests per second, for a rate-limit error.

Empty if the broker stated none or an unusable one. KIS never states one.

Definition at line 785 of file types.hpp.

◆ reached_broker_

◆ request_id_

std::string algotradelib::BrokerError::request_id_

The broker's request id for this call, if it gave one.

Definition at line 763 of file types.hpp.

◆ retry_after_

std::optional<std::chrono::seconds> algotradelib::BrokerError::retry_after_

How long the broker asked the caller to wait (Retry-After), for a rate-limit error.

Empty if the broker sent none or an unreadable one; back off on your own then rather than retrying at once.

Definition at line 779 of file types.hpp.


The documentation for this struct was generated from the following file: