Skip to main content

config_resolver/
error.rs

1use thiserror::Error;
2
3/// Errors that can occur during configuration resolution.
4#[derive(Error, Debug)]
5pub enum Error {
6    /// The specification string is invalid or cannot be parsed.
7    #[error("Invalid specification: {0}")]
8    InvalidSpec(String),
9
10    /// The requested configuration provider was not found in the registry.
11    #[error("Provider not found: {0}")]
12    ProviderNotFound(String),
13
14    /// The provider failed to resolve the value.
15    #[error("Resolution failed: {0}")]
16    ResolutionFailed(String),
17
18    /// The resolved type does not match the requested type.
19    #[error("Type mismatch")]
20    TypeMismatch,
21
22    /// An error occurred during an HTTP request.
23    #[cfg(feature = "reqwest")]
24    #[error("HTTP error: {0}")]
25    HttpError(#[from] reqwest::Error),
26
27    /// Sync resolution is not supported by this provider.
28    #[error("Sync resolution not supported for provider: {0}")]
29    SyncResolutionNotSupported(String),
30
31    /// An error occurred while parsing a value.
32    #[error("Parse error: {0}")]
33    ParseError(String),
34}