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
pub mod errors;
pub mod kube_config;
pub mod wasi_outbound_http_helper_k8s;
pub use kube_conf;
wit_bindgen_rust::import!("wit/ephemeral/wasi-outbound-http.wit");
impl std::fmt::Display for wasi_outbound_http::HttpError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let msg = match *self {
wasi_outbound_http::HttpError::Success => "success",
wasi_outbound_http::HttpError::DestinationNotAllowed => "destination not allowed",
wasi_outbound_http::HttpError::InvalidCfg => "invalid config",
wasi_outbound_http::HttpError::InvalidUrl => "invalid URL",
wasi_outbound_http::HttpError::RequestError => "request error",
wasi_outbound_http::HttpError::RuntimeError => "runtime error",
};
write!(f, "{}", msg)
}
}
impl std::error::Error for wasi_outbound_http::HttpError {}