#[non_exhaustive]pub enum Error {
Api(ApiError),
Validation(ValidationError),
Network(NetworkError),
Timeout(TimeoutError),
Decode(DecodeError),
WebhookVerification(WebhookVerificationError),
Preempted(PreemptedError),
}Expand description
Every error of this SDK. Cancelling a call is not an error: drop its future.
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(ApiError)
The API answered with an error: a REST error, a refused WebSocket dial or a
terminal connection.error frame.
Validation(ValidationError)
A local check failed before any request or dial.
Network(NetworkError)
The network failed (connect, TLS, reset, body read).
Timeout(TimeoutError)
An attempt or the whole call ran out of time.
Decode(DecodeError)
A response could not be decoded.
WebhookVerification(WebhookVerificationError)
A webhook did not pass verification.
Preempted(PreemptedError)
The stream was preempted by the server.
Implementations§
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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<PreemptedError> for Error
impl From<PreemptedError> for Error
Source§fn from(e: PreemptedError) -> Self
fn from(e: PreemptedError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Forget for Error
impl Freeze for Error
impl Move for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Errorwhere
*const ApiErrorData is !null: UnsafeUnpin,
PhantomData<ApiErrorData>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const dyn Error + Sync + Send is !null: UnsafeUnpin,
PhantomData<dyn Error + Sync + Send>: UnsafeUnpin,
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