pub enum Error {
Client(Box<dyn Error + Send + Sync + 'static>),
Request(Box<dyn Error + Send + Sync + 'static>),
Response(Box<dyn Error + Send + Sync + 'static>),
Body(Box<dyn Error + Send + Sync + 'static>),
Status(StatusCode),
}
Expand description
Pretend errors
This error type wraps errors emitted
by pretend
or by client implementations.
Variants§
Client(Box<dyn Error + Send + Sync + 'static>)
Error when creating a client implementation
Request(Box<dyn Error + Send + Sync + 'static>)
Error when building the request
Response(Box<dyn Error + Send + Sync + 'static>)
Error when executing the request
Body(Box<dyn Error + Send + Sync + 'static>)
Error when parsing the response body
Status(StatusCode)
HTTP status error
This error is returned when the request failed with an HTTP error status. It is only returned when methods returns bodies.
Implementations§
source§impl Error
impl Error
sourcepub fn client<E>(err: E) -> Selfwhere
E: Error + 'static + Send + Sync,
pub fn client<E>(err: E) -> Selfwhere E: Error + 'static + Send + Sync,
Construct a new Client
error
sourcepub fn request<E>(err: E) -> Selfwhere
E: Error + 'static + Send + Sync,
pub fn request<E>(err: E) -> Selfwhere E: Error + 'static + Send + Sync,
Construct a new Request
error
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)>
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()