#[non_exhaustive]pub enum Error {
MissingApiKey,
InvalidBaseUrl(ParseError),
Api(Box<ApiError>),
Network(Error),
Timeout {
timeout_secs: u64,
},
Aborted,
Decode(Error),
MalformedStreamEvent(String),
}Expand description
Errors returned by every fallible operation in this crate.
Transport, decoding, timeout, and cancellation failures are distinct
variants so callers can react to each without string matching. API-level
failures (any non-2xx response with a parseable body) are carried by
Error::Api wrapping an ApiError.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
MissingApiKey
No API key was supplied and SKAILAR_API_KEY was unset or empty.
InvalidBaseUrl(ParseError)
The configured base URL could not be parsed.
Api(Box<ApiError>)
The gateway returned a non-2xx status.
Network(Error)
A transport-level failure occurred (DNS, TLS, connection reset).
Timeout
The request exceeded the configured per-attempt timeout.
Aborted
The request was aborted by the caller before completion.
Decode(Error)
A successful response carried a body that could not be deserialized.
MalformedStreamEvent(String)
A streaming event could not be parsed.
Implementations§
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()