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    #[error(transparent)]
21    IOError(#[from] std::io::Error),
22    #[cfg(feature = "json")]
23    #[error(transparent)]
24    JsonError(#[from] serde_json::Error),
25    #[error(transparent)]
26    UrlError(#[from] url::ParseError),
27}