pub enum HttpError {
ClientInit(String),
RequestFailed {
url: String,
message: String,
},
HttpStatus {
url: String,
status: u16,
},
BodyReadFailed {
url: String,
message: String,
},
InvalidResponse {
url: String,
message: String,
},
NoWindow,
WorkerPanicked {
operation: &'static str,
},
UnsupportedFeature {
operation: &'static str,
feature: &'static str,
},
Cancelled,
FileWrite {
path: String,
kind: ErrorKind,
message: String,
},
}Expand description
Why an HTTP transfer failed.
Variants§
ClientInit(String)
The platform could not create its HTTP client. The text describes the cause.
RequestFailed
The request could not be sent or got no response.
HttpStatus
The server answered with a status outside the 2xx range.
BodyReadFailed
The response body ended early or could not be read.
InvalidResponse
The response is not usable, such as a body that is not valid UTF-8 text.
NoWindow
The browser gave no window object to send the request through.
WorkerPanicked
A worker thread that ran part of the operation panicked.
UnsupportedFeature
The operation needs a cranpose-services feature that is turned off.
Fields
Cancelled
The caller cancelled the transfer through its HttpControl.
FileWrite
A downloaded file could not be written to disk.
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