#[non_exhaustive]pub enum SdkError {
Api {
status: u16,
body: ApiErrorResponse,
},
Http {
status: u16,
message: String,
},
Auth(String),
Token(TokenFormatError),
Transport(String),
Deserialize(String),
Config(String),
Serialize(String),
ResourceNotFound {
resource_type: &'static str,
name: String,
},
AmbiguousResource {
resource_type: &'static str,
name: String,
matches: Vec<Value>,
match_count: usize,
},
Other(Error),
}Expand description
Exhaustive error returned by the high-level client.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Api
The API returned a non-2xx response with a JSON ApiErrorResponse body.
Fields
body: ApiErrorResponseParsed error envelope.
Http
The API returned a non-2xx response whose body was not parseable JSON.
Auth(String)
Authentication failed: missing, malformed, or rejected token.
Token(TokenFormatError)
Token parsing failed before any request was sent.
Transport(String)
Transport-level failure (DNS, TLS, connection reset, timeout…).
Deserialize(String)
Server reply could not be decoded (unexpected shape, invalid JSON).
Config(String)
Invalid SDK configuration (base URL missing, conflicting options, …).
Serialize(String)
The caller-provided data could not be serialized into a request body.
ResourceNotFound
No resource matched the requested localized name.
Fields
AmbiguousResource
Multiple resources matched the same localized name.
Fields
Other(Error)
Catch-all for anything else; always prefer a more specific variant.
Implementations§
Trait Implementations§
Source§impl Error for SdkError
impl Error for SdkError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()