Skip to main content

hyperinfer_router/
error.rs

1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum RoutingError {
5    #[error("no deployments available for model: {0}")]
6    NoDeployments(String),
7
8    #[error("all deployments failed for model: {0}")]
9    AllDeploymentsFailed(String),
10
11    #[error("max attempts exceeded ({attempts} attempts)")]
12    MaxAttemptsExceeded { attempts: u32 },
13
14    #[error("global routing timeout ({timeout_ms}ms)")]
15    GlobalTimeout { timeout_ms: u64 },
16
17    #[error("strategy error: {0}")]
18    StrategyError(String),
19
20    #[error("redis error: {0}")]
21    Redis(#[from] redis::RedisError),
22
23    #[error("configuration error: {0}")]
24    Config(String),
25
26    #[error("provider error: status={status}, message={message}")]
27    ProviderError { status: u16, message: String },
28
29    #[error("executor panicked during request processing")]
30    ExecutorPanic,
31}