pub enum Error {
Show 13 variants
Auth(String),
RateLimit {
retry_after: Option<Duration>,
},
InvalidRequest(String),
ContextTooLong {
max_tokens: u32,
requested_tokens: u32,
},
ModelUnavailable(String),
ServerError {
status: u16,
body: String,
},
UpstreamServerFault(String),
ContentFilter(String),
Network(Box<dyn Error + Send + Sync>),
StreamInterrupted(String),
Cancelled,
Adapter(Box<dyn Error + Send + Sync>),
StreamIdle(Duration),
}Expand description
All errors that can be produced by a caliban provider.
Variants§
Auth(String)
Authentication credentials were missing or rejected.
RateLimit
The provider rejected the request due to rate limiting.
InvalidRequest(String)
The request was structurally invalid.
ContextTooLong
The request exceeds the model’s context window.
Fields
The requested model is not available via this provider.
ServerError
The provider returned an HTTP error response.
UpstreamServerFault(String)
The upstream model server reported an internal fault (process
crash, OOM kill, segfault, etc.) — distinct from ServerError
because the fault may arrive in-band (HTTP 200 + SSE error
payload, as LM Studio does when the model crashes mid-stream).
The fault is server-side, not request-side, so callers should
surface it as such rather than as InvalidRequest.
ContentFilter(String)
The response was blocked by a content-safety filter.
Network(Box<dyn Error + Send + Sync>)
A transport-level network error occurred.
StreamInterrupted(String)
The HTTP response body was severed mid-stream. Distinct from
Network because the request itself succeeded (the upstream
accepted it and started replying) — what failed was reading the
streaming body to completion. Typical triggers: TCP RST or FIN
from upstream while the SSE stream was in flight, idle teardown
by NAT/proxy, or a transient connection reset. The wrapped
string is the underlying transport error chain, captured at the
point the chunk read failed.
Cancelled
The operation was cancelled before completion.
Adapter(Box<dyn Error + Send + Sync>)
An adapter-specific error that does not fit other categories.
StreamIdle(Duration)
The streaming response went silent past the idle timeout.
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()