systemprompt_models/profile/gateway/
error.rs1use thiserror::Error;
9
10#[derive(Debug, Error)]
11pub enum GatewayProfileError {
12 #[error("gateway route id '{id}' is declared more than once")]
13 DuplicateRouteId { id: String },
14
15 #[error("gateway route '{route}' provider '{provider}' is not declared in profile.providers")]
16 RouteProviderNotInRegistry { route: String, provider: String },
17
18 #[error("gateway default_provider '{provider}' is not declared in profile.providers")]
19 DefaultProviderNotInRegistry { provider: String },
20
21 #[error("system_prompt override with action 'replace' must set a 'prompt'")]
22 OverrideReplaceMissingPrompt,
23
24 #[error("system_prompt override with action 'strip' must not set a 'prompt'")]
25 OverrideStripWithPrompt,
26
27 #[error("system_prompt override provider '{provider}' is not declared in profile.providers")]
28 OverrideProviderNotInRegistry { provider: String },
29
30 #[error("route `when.min_tools` must be at least 1 (0 matches every request)")]
31 RouteMatchZeroMinTools,
32
33 #[error("route `when` sets `requires_tools: false` but also a positive `min_tools`")]
34 RouteMatchContradictoryTools,
35}
36
37pub type GatewayResult<T> = Result<T, GatewayProfileError>;