Skip to main content

systemprompt_provider_contracts/web_config/
error.rs

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