1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
use core::fmt;
use hyper::Error as HyperError;
//
#[derive(Debug)]
pub enum Error {
HyperError(HyperError),
Other(Box<dyn std::error::Error + Send + Sync + 'static>),
}
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{:?}", self)
}
}
impl std::error::Error for Error {}
//
impl From<HyperError> for Error {
fn from(err: HyperError) -> Self {
Self::HyperError(err)
}
}