#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum Error {
#[error("invalid configuration: {0}")]
Config(&'static str),
#[error("subscription error: {0}")]
Subscription(&'static str),
#[error("cache error: {0}")]
Cache(&'static str),
#[error("network error: {0}")]
Transport(#[source] reqwest::Error),
#[error("file access error: {0}")]
Io(#[from] std::io::Error),
#[error("no eligible proxy is available")]
NoProxyAvailable,
#[error("all eligible proxies are at their in-flight request limit")]
PoolSaturated,
#[error("could not initialize subscriptions: {0:?}")]
Initialization(Vec<crate::SourceReport>),
}
pub type Result<T> = std::result::Result<T, Error>;
impl From<reqwest::Error> for Error {
fn from(error: reqwest::Error) -> Self {
Self::Transport(error.without_url())
}
}