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