2022-06-07 20:36:26 +00:00
|
|
|
#[derive(Debug, thiserror::Error)]
|
2022-04-18 12:13:15 +00:00
|
|
|
pub enum Error {
|
2022-06-07 20:36:26 +00:00
|
|
|
#[error("axum error - {0}")]
|
2022-04-18 12:13:15 +00:00
|
|
|
Axum(axum::Error),
|
2022-06-07 20:36:26 +00:00
|
|
|
|
|
|
|
#[error("hyper error - {0}")]
|
2022-04-18 12:13:15 +00:00
|
|
|
Hyper(hyper::Error),
|
2022-06-07 20:36:26 +00:00
|
|
|
|
|
|
|
#[error("std::net::AddrParseError - {0}")]
|
2022-04-18 12:13:15 +00:00
|
|
|
AddrParseError(std::net::AddrParseError),
|
|
|
|
}
|
|
|
|
|
|
|
|
pub type Result<T> = std::result::Result<T, Error>;
|
|
|
|
|
|
|
|
impl From<axum::Error> for Error {
|
|
|
|
fn from(err: axum::Error) -> Self {
|
|
|
|
Error::Axum(err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl From<hyper::Error> for Error {
|
|
|
|
fn from(err: hyper::Error) -> Self {
|
|
|
|
Error::Hyper(err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl From<std::net::AddrParseError> for Error {
|
|
|
|
fn from(err: std::net::AddrParseError) -> Self {
|
|
|
|
Error::AddrParseError(err)
|
|
|
|
}
|
|
|
|
}
|