21 lines
498 B
Rust
21 lines
498 B
Rust
use thiserror::Error;
|
|
|
|
#[derive(Debug, Error)]
|
|
pub enum ConfigError {
|
|
#[error("config key '{key}' not found")]
|
|
NotFound { key: String },
|
|
|
|
#[error("config key '{key}': expected {expected}, got '{got}'")]
|
|
TypeMismatch {
|
|
key: String,
|
|
expected: String,
|
|
got: String,
|
|
},
|
|
|
|
#[error("config parse error: {0}")]
|
|
ParseError(String),
|
|
|
|
#[error("config source error '{source_name}': {message}")]
|
|
SourceError { source_name: String, message: String },
|
|
}
|