autumn_plugin_pingora/
error.rs1use std::net::SocketAddr;
4
5use crate::config::ConfigError;
6
7#[derive(Debug, thiserror::Error)]
10#[non_exhaustive]
11pub enum PingoraError {
12 #[error(transparent)]
14 Config(#[from] ConfigError),
15 #[error("cannot bind the proxy listener on {addr}: {source}")]
17 Bind {
18 addr: SocketAddr,
20 source: std::io::Error,
22 },
23 #[error("route `{route}`: cannot resolve upstream \"{upstream}\": {reason}")]
25 Resolve {
26 route: String,
28 upstream: String,
30 reason: String,
32 },
33 #[error("cannot resolve the Autumn app address \"{0}\" for `fallback = \"app\"`")]
35 AppAddress(String),
36 #[error(
38 "`fallback = \"app\"` needs a plain HTTP app. `[server.tls]` is set. Put a TLS terminator in front of the proxy, or set `fallback = \"none\"`"
39 )]
40 FallbackTls,
41 #[error(
43 "the proxy address is the Autumn app address {0}. With `fallback = \"app\"`, requests would go in a loop. Set a different `bind`"
44 )]
45 FallbackLoop(SocketAddr),
46 #[error("the proxy started or stopped before; it can start one time only")]
48 AlreadyStarted,
49}