1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
use thiserror::Error;
pub use kube_core::ErrorResponse;
#[cfg_attr(docsrs, doc(cfg(any(feature = "config", feature = "client"))))]
#[derive(Error, Debug)]
pub enum Error {
#[error("ApiError: {0} ({0:?})")]
Api(#[source] ErrorResponse),
#[cfg(feature = "client")]
#[error("HyperError: {0}")]
HyperError(#[source] hyper::Error),
#[cfg(feature = "client")]
#[error("ServiceError: {0}")]
Service(#[source] tower::BoxError),
#[error("UTF-8 Error: {0}")]
FromUtf8(#[source] std::string::FromUtf8Error),
#[error("Error finding newline character")]
LinesCodecMaxLineLengthExceeded,
#[error("Error reading events stream: {0}")]
ReadEvents(#[source] std::io::Error),
#[error("HttpError: {0}")]
HttpError(#[source] http::Error),
#[error("Error deserializing response")]
SerdeError(#[source] serde_json::Error),
#[error("Failed to build request: {0}")]
BuildRequest(#[source] kube_core::request::Error),
#[error("Failed to infer configuration: {0}")]
InferConfig(#[source] crate::config::InferConfigError),
#[error("Error from discovery: {0}")]
Discovery(#[source] DiscoveryError),
#[cfg(feature = "native-tls")]
#[cfg_attr(docsrs, doc(cfg(feature = "native-tls")))]
#[error("native tls error: {0}")]
NativeTls(#[source] crate::client::NativeTlsError),
#[cfg(feature = "openssl-tls")]
#[cfg_attr(docsrs, doc(cfg(feature = "openssl-tls")))]
#[error("openssl tls error: {0}")]
OpensslTls(#[source] crate::client::OpensslTlsError),
#[cfg(feature = "rustls-tls")]
#[cfg_attr(docsrs, doc(cfg(feature = "rustls-tls")))]
#[error("rustls tls error: {0}")]
RustlsTls(#[source] crate::client::RustlsTlsError),
#[cfg(feature = "ws")]
#[cfg_attr(docsrs, doc(cfg(feature = "ws")))]
#[error("failed to upgrade to a WebSocket connection: {0}")]
UpgradeConnection(#[source] crate::client::UpgradeConnectionError),
#[cfg(feature = "client")]
#[cfg_attr(docsrs, doc(cfg(feature = "client")))]
#[error("auth error: {0}")]
Auth(#[source] crate::client::AuthError),
}
#[derive(Error, Debug)]
pub enum DiscoveryError {
#[error("Invalid GroupVersion: {0}")]
InvalidGroupVersion(String),
#[error("Missing Kind: {0}")]
MissingKind(String),
#[error("Missing Api Group: {0}")]
MissingApiGroup(String),
#[error("Missing Resource: {0}")]
MissingResource(String),
#[error("Empty Api Group: {0}")]
EmptyApiGroup(String),
}