1use thiserror::Error;
7
8pub type BoxError = Box<dyn std::error::Error + Send + Sync + 'static>;
10
11pub type Result<T> = std::result::Result<T, ProxyError>;
13
14#[derive(Debug, Error)]
16pub enum ProxyError {
17 #[error("invalid config: {0}")]
18 InvalidConfig(#[source] BoxError),
19 #[error("missing field: {0}")]
20 MissingField(#[source] BoxError),
21 #[error("parse error: {0}")]
22 ParseError(#[source] BoxError),
23 #[error("get proxy error: {0}")]
24 GetProxy(#[source] BoxError),
25 #[error("proxy not found")]
26 ProxyNotFound,
27 #[error("proxy not available: {0}")]
28 ProxyNotAvailable(#[source] BoxError),
29 #[error("proxy already expired")]
30 ProxyExpired,
31 #[error("proxy provider already expired")]
32 ProxyProviderExpired,
33 #[error("proxy connection failed")]
34 ProxyConnectionFailed,
35 #[error("proxy authentication failed")]
36 ProxyAuthenticationFailed,
37}