#[non_exhaustive]pub enum LlmClientError {
InvalidRequest {
message: String,
},
RequestTranslation(String),
RequestEncoding(String),
ResponseTranslation(String),
Configuration {
message: String,
},
Transport {
source: BoxError,
},
Timeout {
source: BoxError,
},
ContextWindowExceeded {
model: String,
message: String,
},
UpstreamHttp {
status: u16,
body: String,
},
InvalidResponse {
source: BoxError,
},
Ffi {
source: BoxError,
},
General(String),
}Expand description
Failures a routed LLM client can surface to its caller.
The variants classify failures that routing hosts commonly need to handle,
while boxed sources preserve implementation-specific detail. General is the
escape hatch for failures that do not fit a shared category.
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.
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.
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 message. Useful in testing, but prefer adding variants over using this.
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()