#[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),
Other(Error),
}Expand description
Exhaustive error returned by the high-level client.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
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.
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)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<TokenFormatError> for SdkError
impl From<TokenFormatError> for SdkError
Source§fn from(source: TokenFormatError) -> SdkError
fn from(source: TokenFormatError) -> SdkError
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for SdkError
impl RefUnwindSafe for SdkError
impl Send for SdkError
impl Sync for SdkError
impl Unpin for SdkError
impl UnsafeUnpin for SdkError
impl UnwindSafe for SdkError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more