pub enum BoxxkiteError {
Api {
status: u16,
code: String,
message: String,
retryable: bool,
remediation: Option<String>,
},
Connection(Error),
Decode(Error),
WebSocket(Error),
EventStream(Box<Error>),
Config(String),
}Expand description
Everything this crate’s Result<T, BoxxkiteError> can fail with.
Mirrors sdk-python’s BoxxkiteApiError/BoxxkiteConnectionError split
(both subclass BoxxkiteError there; here both are variants of one enum,
the idiomatic Rust shape for a small, closed set of error kinds).
Variants§
Api
The control-plane responded with a non-2xx status. code is the
machine-readable error.code field from the response envelope
({"error": {"code", "message"}}) – see docs/API.md’s “Error
codes” table for the full list this API can return.
Connection(Error)
The request never reached the control-plane, or its response couldn’t be read (DNS failure, connection refused, TLS error, timeout, etc).
Decode(Error)
A response body that was expected to be well-formed JSON wasn’t, or couldn’t be deserialized into the expected shape.
WebSocket(Error)
A WebSocket-based call (takeover) failed to connect or errored
mid-stream.
EventStream(Box<Error>)
The Server-Sent Events stream (watch) errored. Boxed: the largest
variant of the underlying reqwest_eventsource::Error embeds a full
reqwest::Response, which would otherwise make every BoxxkiteError
(including cheap ones like Config) pay for that size on the stack.
Config(String)
A caller-supplied argument was invalid before any request was even
sent – e.g. a non-https:// base_url that isn’t localhost (see
ClientBuilder::build’s doc comment for why this is rejected rather
than silently sent in cleartext).
Implementations§
Trait Implementations§
Source§impl Debug for BoxxkiteError
impl Debug for BoxxkiteError
Source§impl Display for BoxxkiteError
impl Display for BoxxkiteError
Source§impl Error for BoxxkiteError
impl Error for BoxxkiteError
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()