#[non_exhaustive]pub enum LlmClientError {
Show 16 variants
InvalidRequest {
message: String,
},
RequestTranslation(String),
RequestEncoding(String),
ResponseTranslation(String),
Configuration {
message: String,
},
ResponseStateLimitExceeded {
limit: usize,
},
ResponseStateConflict,
TemporarilyUnavailable,
Transport {
source: BoxError,
},
Timeout {
source: BoxError,
},
ContextWindowExceeded {
model: ModelId,
message: String,
},
UpstreamHttp {
status: StatusCode,
body: String,
},
InvalidResponse {
source: BoxError,
},
Host {
source: BoxError,
},
Ffi {
source: BoxError,
},
General(String),
}Expand description
Failures a routed LLM client can surface to its caller.
Boxed sources preserve client-specific errors; General keeps only a message.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidRequest
The request cannot be served as supplied.
RequestTranslation(String)
Decoding the inbound request failed in the translation engine.
RequestEncoding(String)
Encoding the request for the upstream failed in the translation engine.
ResponseTranslation(String)
Decoding or encoding the response failed in the translation engine.
Configuration
The client is not configured to serve the selected target.
ResponseStateLimitExceeded
The route cannot record another provider-owned response or conversation ID.
ResponseStateConflict
Two configured models reported the same saved response or conversation ID.
The selected backend is temporarily unavailable. Another candidate may serve the request.
Transport
The upstream could not be reached or the request could not be sent.
Timeout
The upstream request exceeded its timeout.
ContextWindowExceeded
The upstream rejected the request because it exceeds the model’s context window.
Fields
UpstreamHttp
The upstream returned a non-success HTTP response.
InvalidResponse
The upstream returned a response the client could not decode.
Host
A native host failure that does not fit another category. The default completion runner treats it as terminal.
Ffi
A call across a foreign-function boundary (e.g. a Python-implemented client) failed. The boxed source is the foreign error itself.
General(String)
A string-only failure. Useful in testing; prefer a typed variant when possible.
Trait Implementations§
Source§impl Debug for LlmClientError
impl Debug for LlmClientError
Source§impl Display for LlmClientError
impl Display for LlmClientError
Source§impl Error for LlmClientError
impl Error for LlmClientError
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()