50using Result = std::expected<T, Error>;
std::expected< T, Error > Result
Result type for SDK operations.
Definition error.hpp:50
ErrorCode
Definition error.hpp:10
@ InvalidKey
The private key could not be loaded.
@ NetworkError
The request did not complete (DNS, TLS, timeout, reset), or HTTP 408.
@ RateLimited
HTTP 429, or a local rate limit that would wait too long.
@ SigningError
The request could not be signed.
@ InvalidRequest
Rejected before sending, or another HTTP 4xx.
@ AuthenticationError
HTTP 401 or 403.
@ ParseError
The response was not the JSON the API documents.
static Error network(std::string msg)
Definition error.hpp:31
static Error auth(std::string msg)
Definition error.hpp:35
std::string api_code
Kalshi's machine-readable error code, such as "market_not_found", when sent.
Definition error.hpp:29
int http_status
HTTP status when the server answered; 0 otherwise.
Definition error.hpp:27
static Error parse(std::string msg)
Definition error.hpp:39
std::string message
Definition error.hpp:25
static Error signing(std::string msg)
Definition error.hpp:43
ErrorCode code
Definition error.hpp:24