#[non_exhaustive]pub enum ErrorClass {
Auth,
RateLimit {
retry_after: Option<Duration>,
},
Server,
Client,
Timeout,
Transport,
Cancelled,
AddressDenied,
Invalid,
}Expand description
Coarse class of an HttpError, from HttpError::class. Apps map their own error
classes and retry sets from this one table instead of matching statuses themselves.
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.
Auth
HTTP 401, 403 or 407.
RateLimit
HTTP 429. retry_after is the parsed Retry-After delay, when the server sent one.
Server
HTTP 5xx.
Client
Any other status: 4xx not listed above, or an unfollowed 3xx.
Timeout
A configured timeout elapsed, or the server answered HTTP 408 Request Timeout.
Transport
Connection, TLS or socket failure, or an exhausted redirect limit.
Cancelled
The call was cancelled.
AddressDenied
The outbound address policy refused the destination.
Invalid
The request could not be built, or the response body was malformed or oversized
(InvalidRequest, Json, Stream, BodyTooLarge), or https_only refused a URL
(HttpsRequired).
Trait Implementations§
Source§impl Clone for ErrorClass
impl Clone for ErrorClass
impl Copy for ErrorClass
Source§impl Debug for ErrorClass
impl Debug for ErrorClass
impl Eq for ErrorClass
Source§impl PartialEq for ErrorClass
impl PartialEq for ErrorClass
impl StructuralPartialEq for ErrorClass
Auto Trait Implementations§
impl Freeze for ErrorClass
impl RefUnwindSafe for ErrorClass
impl Send for ErrorClass
impl Sync for ErrorClass
impl Unpin for ErrorClass
impl UnsafeUnpin for ErrorClass
impl UnwindSafe for ErrorClass
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