#[non_exhaustive]pub enum LlmError {
Network(String),
Timeout,
RateLimit {
retry_after_secs: u32,
},
Unauthorized,
BadRequest(String),
Server(String),
Decoding(String),
Unsupported(String),
Cancelled,
Suspended {
reason: String,
},
}Expand description
LLM provider errors.
Marked #[non_exhaustive] so additional variants can be introduced
without a major-version bump on impl crates that match on the enum.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Network(String)
Network transport failure (connection refused, DNS, etc).
Timeout
Request exceeded its deadline.
RateLimit
Provider returned a 429-equivalent rate-limit signal.
Authentication or authorisation failure.
BadRequest(String)
Provider rejected the request shape.
Server(String)
Provider returned a 5xx-equivalent.
Decoding(String)
Response payload could not be decoded.
Unsupported(String)
Capability declared unsupported by the client.
Cancelled
Operation was cooperatively cancelled. Surfaced from the
streaming runtime when ctx.cancel fires mid-stream so consumers
can distinguish a cooperative cancel from a provider failure.
Suspended
The run suspended at a human-review gate (ADR-045) rather than
failing. Emitted as the streaming path’s terminal item when a
ReviewPolicy pauses a step: the durable RunCheckpoint was
persisted to RunOptions::checkpoint_kv_bucket, and the run resumes
via resume_from_checkpoint. Not retryable — and not a failure, so the
streaming driver records no Episode::Failed for it.
Implementations§
Trait Implementations§
Source§impl Error for LlmError
impl Error for LlmError
1.30.0 · 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()