pub enum HttpError {
InvalidRequest(String),
Transport {
message: String,
connect_phase: bool,
},
Timeout(String),
Status {
status: u16,
body: String,
retry_after: Option<Duration>,
attempts: u32,
},
BodyTooLarge {
limit: usize,
},
Json(String),
Stream(String),
}Variants§
InvalidRequest(String)
URL, header, or request construction failed before anything was sent.
Transport
Connection, TLS, or socket failure. connect_phase is true when nothing
can have reached the server (safe to retry any method).
Timeout(String)
A configured timeout elapsed.
Status
Non-2xx response (after retries were exhausted or not applicable).
BodyTooLarge
Response body exceeded the configured limit.
Json(String)
Response was not valid JSON for the requested type.
Stream(String)
Streaming protocol violation (oversized SSE line, bad UTF-8, …).
Implementations§
Trait Implementations§
Source§impl Error for HttpError
impl Error for HttpError
1.30.0 · 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()
Auto Trait Implementations§
impl Freeze for HttpError
impl RefUnwindSafe for HttpError
impl Send for HttpError
impl Sync for HttpError
impl Unpin for HttpError
impl UnsafeUnpin for HttpError
impl UnwindSafe for HttpError
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