warp_request_body/
error.rs

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