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
use super::wasi_outbound_http;
use k8s_openapi::http;
use thiserror::Error;
#[derive(Error, Debug)]
pub enum KrewWasmSDKError {
#[error("kube-conf error")]
KubeConfigError(#[from] kube_conf::errors::Error),
#[error("kube-conf: no default kubernetes context")]
KubeConfigNoContextError(),
#[error("kube-conf: no cluster definition")]
KubeConfigNoClusterDefinitionError(),
#[error("kube-conf: no user definition")]
KubeConfigNoUserDefinitionError(),
#[error("kube-conf error: {0}")]
KubeConfigGenericError(String),
#[error("wasi-http error")]
KubeWasiHttpError(#[from] wasi_outbound_http::HttpError),
#[error("http method not handled by wasi_outbound_http")]
KubeWasiHttpMethodConversionError(),
#[error("http error")]
HttpError(#[from] http::Error),
#[error("http invalid URI")]
HttpInvalidUriError(#[from] http::uri::InvalidUri),
#[error("invalid header (expected {expected:?}, found {found:?})")]
InvalidHeader { expected: String, found: String },
#[error("unknown data store error")]
Unknown,
}
pub type Result<T> = std::result::Result<T, KrewWasmSDKError>;