1use std::path::PathBuf;
4
5pub type Result<T> = std::result::Result<T, ConfigError>;
7
8#[derive(Debug, thiserror::Error)]
10pub enum ConfigError {
11 #[error("Configuration file not found: {0}")]
13 FileNotFound(PathBuf),
14
15 #[error("I/O error reading configuration: {0}")]
17 Io(#[from] std::io::Error),
18
19 #[error("TOML parsing error: {0}")]
21 TomlParse(#[from] toml::de::Error),
22
23 #[error("TOML serialization error: {0}")]
25 TomlSerialize(#[from] toml::ser::Error),
26
27 #[error("Configuration validation error: {0}")]
29 Validation(String),
30
31 #[error("Missing required field: {0}")]
33 MissingField(String),
34
35 #[error("Invalid value for field '{field}': {reason}")]
37 InvalidValue {
38 field: String,
40 reason: String,
42 },
43
44 #[error("Environment variable error: {0}")]
46 EnvVar(String),
47
48 #[error("Workspace configuration error: {0}")]
50 Workspace(String),
51}