subscription_proxy_pool/
error.rs1#[derive(Debug, thiserror::Error)]
3#[non_exhaustive]
4pub enum Error {
5 #[error("invalid configuration: {0}")]
7 Config(&'static str),
8 #[error("subscription error: {0}")]
10 Subscription(&'static str),
11 #[error("cache error: {0}")]
13 Cache(&'static str),
14 #[error("network error: {0}")]
16 Transport(#[source] reqwest::Error),
17 #[error("file access error: {0}")]
19 Io(#[from] std::io::Error),
20 #[error("no eligible proxy is available")]
22 NoProxyAvailable,
23 #[error("all eligible proxies are at their in-flight request limit")]
25 PoolSaturated,
26 #[error("could not initialize subscriptions: {0:?}")]
28 Initialization(Vec<crate::SourceReport>),
29}
30
31pub type Result<T> = std::result::Result<T, Error>;
33
34impl From<reqwest::Error> for Error {
35 fn from(error: reqwest::Error) -> Self {
36 Self::Transport(error.without_url())
37 }
38}