pub enum HttpError {
Network(Error),
Middleware(Error),
Serialization(String),
Auth(String),
Timeout,
ResponseTooLarge {
limit: usize,
},
Config(String),
Other(String),
}Expand description
Transport-level errors: failures where no safely inspectable HTTP response is available to the caller.
HTTP responses with non-2xx status codes are surfaced as
ApiError inside ApiOpError::Api, not here, so callers can
always inspect status, headers, and the raw body when the server
actually responded.
Variants§
Network(Error)
Network or connection error (from reqwest)
Middleware(Error)
Middleware error (from reqwest-middleware)
Serialization(String)
Request serialization error
Auth(String)
Authentication error
Timeout
Request timeout
ResponseTooLarge
A response body exceeded the configured in-memory limit
Config(String)
Invalid configuration
Other(String)
Generic error
Implementations§
Source§impl HttpError
impl HttpError
Sourcepub fn serialization_error(error: impl Display) -> Self
pub fn serialization_error(error: impl Display) -> Self
Create a serialization error
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Check if this transport error is retryable
Trait Implementations§
Source§impl Error for HttpError
impl Error for HttpError
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 !RefUnwindSafe for HttpError
impl !UnwindSafe for HttpError
impl Freeze for HttpError
impl Send for HttpError
impl Sync for HttpError
impl Unpin for HttpError
impl UnsafeUnpin 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