#[non_exhaustive]pub enum InferenceError {
Show 14 variants
RateLimited {
provider: ProviderKind,
retry_after: Option<Duration>,
},
CircuitOpen {
provider: ProviderKind,
opened_at_unix_ms: u64,
retry_at_unix_ms: u64,
},
ContentFiltered {
reason: String,
},
ContextLengthExceeded {
tokens: u32,
max_tokens: u32,
},
BadRequest {
message: String,
},
Unauthorized {
message: String,
},
Forbidden {
message: String,
},
Backpressure(String),
BudgetExceeded {
deployment: String,
},
NetworkError(String),
ServerError {
status: u16,
body: Option<String>,
},
Timeout {
elapsed_ms: u64,
},
CudaContextPoisoned(String),
Internal(String),
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
RateLimited
429 from a remote provider. Worker backs off and retries unless
max_retries is exhausted; then this surfaces to the request.
CircuitOpen
Circuit breaker is open for (provider, endpoint). Fail-fast.
ContentFiltered
Provider safety filter rejected the input/output. Not retryable.
ContextLengthExceeded
Input exceeded the model’s context window. Not retryable.
BadRequest
400 from the provider — caller-side bug.
401 — triggers RemoteSessionActor::rebuild.
Fields
Forbidden
403 — model/feature access denied.
Backpressure(String)
Mailbox / engine queue full. Upstream decides fallback / 429.
BudgetExceeded
Spend ceiling reached (doc §12.4).
NetworkError(String)
Network blip below the HTTP layer.
ServerError
5xx from provider. Counts toward circuit breaker.
Timeout
Request or read timeout.
CudaContextPoisoned(String)
Local CUDA context poisoned (sticky failure). Triggers two-tier
rebuild on the local WorkerActor → ContextActor boundary.
Internal(String)
Catch-all for runtime-internal bugs. Not retryable.
Implementations§
Source§impl InferenceError
impl InferenceError
pub fn is_retryable(&self) -> bool
Sourcepub fn counts_as_circuit_failure(&self) -> bool
pub fn counts_as_circuit_failure(&self) -> bool
Whether this error counts toward the circuit-breaker failure budget. 429s and content-filter refusals do not (doc §12.2).
Trait Implementations§
Source§impl Clone for InferenceError
impl Clone for InferenceError
Source§fn clone(&self) -> InferenceError
fn clone(&self) -> InferenceError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for InferenceError
impl Debug for InferenceError
Source§impl<'de> Deserialize<'de> for InferenceError
impl<'de> Deserialize<'de> for InferenceError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for InferenceError
impl Display for InferenceError
Source§impl Error for InferenceError
impl Error for InferenceError
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()