crabka_connect/config/
error.rs1use std::error::Error;
2
3pub type ConfigResult<T> = Result<T, ConfigError>;
5
6#[derive(Debug, thiserror::Error)]
8pub enum ConfigError {
9 #[error("unknown config key `{key}`")]
11 UnknownKey { key: String },
12
13 #[error("missing required config key `{key}`")]
15 MissingRequired { key: String },
16
17 #[error("config key `{key}` expected {expected}")]
19 WrongType { key: String, expected: &'static str },
20
21 #[error("invalid default for config key `{key}`: {reason}")]
23 InvalidDefault { key: String, reason: String },
24
25 #[error("invalid secret reference for config key `{key}`: {reason}")]
27 InvalidSecretRef { key: String, reason: String },
28
29 #[error("failed to resolve secret for config key `{key}`: {source}")]
31 SecretResolution {
32 key: String,
33 #[source]
34 source: Box<dyn Error + Send + Sync>,
35 },
36}