Skip to main content

kube_portforward/
error.rs

1use thiserror::Error;
2
3#[derive(Error, Debug)]
4#[non_exhaustive]
5pub enum Error {
6    #[error("port-forward upgrade failed (HTTP {status:?}): {message}")]
7    UpgradeFailed {
8        status: Option<u16>,
9        message: String,
10    },
11
12    #[error("protocol violation in {context}: {detail}")]
13    ProtocolViolation {
14        context: &'static str,
15        detail: String,
16    },
17
18    #[error("session capacity exhausted: {in_use}/{capacity} channel pairs in use")]
19    CapacityExhausted { in_use: usize, capacity: usize },
20
21    #[error("configuration error: {0}")]
22    Configuration(String),
23
24    #[error("network error: {0}")]
25    Network(String),
26
27    #[error(transparent)]
28    Kube(#[from] kube::Error),
29
30    #[error(transparent)]
31    Io(#[from] std::io::Error),
32
33    #[error(transparent)]
34    Spdy(#[from] spdy_mux::Error),
35}