1use reqwest::Error as HTTPError;
4use std::error::Error as StdError;
5use std::fmt::Display;
6use std::result::Result as StdResult;
7
8pub type Result<T> = StdResult<T, Error>;
10
11#[derive(Debug)]
13#[non_exhaustive]
14pub enum Error {
15 Request(Box<HTTPError>),
17}
18
19impl From<HTTPError> for Error {
20 fn from(e: HTTPError) -> Self {
21 Self::Request(Box::new(e))
22 }
23}
24
25impl StdError for Error {}
26
27impl Display for Error {
28 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
29 match self {
30 Error::Request(e) => write!(f, "HTTP request error: {}", e),
31 }
32 }
33}