pub enum Error {
Show 17 variants
Auth(String),
MissingCredentials,
Http(Error),
Api {
status: StatusCode,
body: String,
},
Json(Error),
Url(ParseError),
InvalidHeaderValue(InvalidHeaderValue),
HttpBuild(Error),
WebSocket(Error),
Io(Error),
Timeout,
StreamClosed,
InvalidRateLimitConfig(String),
Env(String),
OrderbookOutOfSync(String),
InvalidFixedPoint(String),
Other(String),
}Expand description
Errors returned by REST, WebSocket, authentication, parsing, and helper APIs.
Variants§
Auth(String)
RSA signing or credential parsing failed.
MissingCredentials
An authenticated endpoint was used without configured credentials.
Http(Error)
The HTTP client failed before receiving an API response.
Api
Kalshi returned a non-2xx HTTP response.
Fields
status: StatusCodeHTTP status code returned by Kalshi.
Json(Error)
JSON serialization or deserialization failed.
Url(ParseError)
URL parsing failed.
InvalidHeaderValue(InvalidHeaderValue)
An authentication header could not be represented as an HTTP header value.
HttpBuild(Error)
HTTP request construction failed.
WebSocket(Error)
WebSocket transport failed.
Io(Error)
File or network I/O failed outside reqwest/tungstenite.
Timeout
An operation exceeded its configured timeout.
StreamClosed
A WebSocket stream closed and could not be reconnected.
InvalidRateLimitConfig(String)
Client-side rate-limit settings were invalid.
Env(String)
Environment-based configuration was invalid.
OrderbookOutOfSync(String)
An orderbook delta could not be safely applied to local state.
InvalidFixedPoint(String)
A fixed-point decimal string was not in the supported format.
Other(String)
A catch-all for errors produced by extension code.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()