feat: added beacon installer generation, download
This commit is contained in:
@@ -10,6 +10,7 @@ pub enum Error {
|
||||
Pbkdf2(pbkdf2::password_hash::errors::Error),
|
||||
#[cfg(feature = "ssr")]
|
||||
Io(std::io::Error),
|
||||
AddrParse(std::net::AddrParseError),
|
||||
}
|
||||
|
||||
impl std::fmt::Display for Error {
|
||||
@@ -37,6 +38,9 @@ impl std::fmt::Display for Error {
|
||||
Error::Io(err) => {
|
||||
write!(f, "io error: {err:?}")
|
||||
}
|
||||
Error::AddrParse(err) => {
|
||||
write!(f, "ip address parse error: {err:?}")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -50,11 +54,23 @@ impl std::error::Error for Error {
|
||||
Error::TokioJoin(err) => Some(err),
|
||||
#[cfg(feature = "ssr")]
|
||||
Error::Io(err) => Some(err),
|
||||
Error::AddrParse(err) => Some(err),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "ssr")]
|
||||
impl axum::response::IntoResponse for Error {
|
||||
fn into_response(self) -> axum::response::Response {
|
||||
(
|
||||
axum::http::StatusCode::INTERNAL_SERVER_ERROR,
|
||||
format!("{:?}", self),
|
||||
)
|
||||
.into_response()
|
||||
}
|
||||
}
|
||||
|
||||
impl std::str::FromStr for Error {
|
||||
type Err = Self;
|
||||
|
||||
@@ -90,3 +106,9 @@ impl From<std::io::Error> for Error {
|
||||
Self::Io(err)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<std::net::AddrParseError> for Error {
|
||||
fn from(err: std::net::AddrParseError) -> Self {
|
||||
Self::AddrParse(err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user