config-resolver 0.2.1

A modular configuration resolver for auto-detecting and resolving runtime values (IPs, ports, peer IDs)
Documentation
use thiserror::Error;

/// Errors that can occur during configuration resolution.
#[derive(Error, Debug)]
pub enum Error {
    /// The specification string is invalid or cannot be parsed.
    #[error("Invalid specification: {0}")]
    InvalidSpec(String),

    /// The requested configuration provider was not found in the registry.
    #[error("Provider not found: {0}")]
    ProviderNotFound(String),

    /// The provider failed to resolve the value.
    #[error("Resolution failed: {0}")]
    ResolutionFailed(String),

    /// The resolved type does not match the requested type.
    #[error("Type mismatch")]
    TypeMismatch,

    /// An error occurred during an HTTP request.
    #[cfg(feature = "reqwest")]
    #[error("HTTP error: {0}")]
    HttpError(#[from] reqwest::Error),

    /// Sync resolution is not supported by this provider.
    #[error("Sync resolution not supported for provider: {0}")]
    SyncResolutionNotSupported(String),

    /// An error occurred while parsing a value.
    #[error("Parse error: {0}")]
    ParseError(String),
}