1#[derive(Debug, thiserror::Error)]
3pub enum ProxyError {
4 #[error("invalid proxy configuration: {0}")]
5 Config(String),
6
7 #[error("failed to bind proxy listener: {0}")]
9 Bind(#[source] std::io::Error),
10
11 #[error("failed to accept connection: {0}")]
13 Accept(#[source] std::io::Error),
14
15 #[error("failed to connect to upstream {host}:{port}: {source}")]
17 UpstreamConnect {
18 host: String,
19 port: u16,
20 source: std::io::Error,
21 },
22
23 #[error("proxy protocol error: {0}")]
24 Protocol(String),
25
26 #[error("proxy request exceeded {0} limit")]
27 Limit(&'static str),
28
29 #[error("proxy operation timed out while reading {0}")]
30 Timeout(&'static str),
31
32 #[error("proxy authentication failed")]
33 Unauthorized,
34
35 #[error("proxy destination rejected: {0}")]
36 Destination(String),
37
38 #[error("proxy I/O: {0}")]
39 Io(#[from] std::io::Error),
40}