Skip to main content

zerolaunch_plugin_api/config/
error.rs

1/// 配置错误类型
2#[derive(Debug, thiserror::Error)]
3pub enum ConfigError {
4    #[error("Component not found: {0}")]
5    NotFound(String),
6
7    #[error("Configuration validation failed: {0}")]
8    ValidationFailed(String),
9
10    #[error("Invalid setting value for key '{key}': {message}")]
11    InvalidValue { key: String, message: String },
12
13    #[error("Configuration apply failed: {0}")]
14    ApplyFailed(String),
15
16    #[error("Persistence error: {0}")]
17    PersistenceError(#[from] std::io::Error),
18
19    #[error("Serialization error: {0}")]
20    SerializationError(#[from] serde_json::Error),
21}