Skip to main content

systemprompt_provider_contracts/web_config/
error.rs

1use std::path::PathBuf;
2
3use thiserror::Error;
4
5#[derive(Debug, Error)]
6pub enum WebConfigError {
7    #[error("Failed to read web config at '{path}': {source}")]
8    Io {
9        path: String,
10        #[source]
11        source: std::io::Error,
12    },
13
14    #[error("Failed to parse web config: {0}")]
15    Parse(#[from] serde_yaml::Error),
16
17    #[error("Missing required field: {field}")]
18    MissingField { field: String },
19
20    #[error("Invalid value for {field}: {message}")]
21    InvalidValue { field: String, message: String },
22
23    #[error("{field} directory not found: {path}")]
24    PathNotFound { field: String, path: PathBuf },
25}