scsys_config/
error.rs

1/*
2    Appellation: error <module>
3    Contrib: FL03 <jo3mccain@icloud.com>
4*/
5#[allow(dead_code)]
6/// a type alias for a [`Result`] type equipped with a custom [`Error`] type
7pub(crate) type Result<T = ()> = core::result::Result<T, ConfigError>;
8
9#[derive(Debug, thiserror::Error)]
10pub enum ConfigError {
11    #[error("Configuration error: {0}")]
12    ParseError(String),
13    #[error("Unknown error: {0}")]
14    Unknown(String),
15    #[cfg(feature = "config")]
16    #[error(transparent)]
17    ConfigError(#[from] config::ConfigError),
18    #[error(transparent)]
19    BoxError(#[from] Box<dyn core::error::Error + Send + Sync + 'static>),
20    #[cfg(feature = "std")]
21    #[error(transparent)]
22    IOError(#[from] std::io::Error),
23    #[cfg(feature = "json")]
24    #[error(transparent)]
25    JsonError(#[from] serde_json::Error),
26    #[cfg(feature = "url")]
27    #[error(transparent)]
28    UrlError(#[from] url::ParseError),
29}