Simplify moar
This commit is contained in:
parent
7f3ec69cf6
commit
07490efc28
14 changed files with 261 additions and 1061 deletions
|
|
@ -6,7 +6,6 @@ pub enum AppError {
|
|||
NotFound,
|
||||
Db(rusqlite::Error),
|
||||
VolumeError(String),
|
||||
NoHealthyVolume,
|
||||
}
|
||||
|
||||
impl From<rusqlite::Error> for AppError {
|
||||
|
|
@ -24,7 +23,6 @@ impl std::fmt::Display for AppError {
|
|||
AppError::NotFound => write!(f, "not found"),
|
||||
AppError::Db(e) => write!(f, "database error: {e}"),
|
||||
AppError::VolumeError(msg) => write!(f, "volume error: {msg}"),
|
||||
AppError::NoHealthyVolume => write!(f, "no healthy volume available"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -33,7 +31,6 @@ impl IntoResponse for AppError {
|
|||
fn into_response(self) -> Response {
|
||||
let (status, msg) = match &self {
|
||||
AppError::NotFound => (StatusCode::NOT_FOUND, self.to_string()),
|
||||
AppError::NoHealthyVolume => (StatusCode::SERVICE_UNAVAILABLE, self.to_string()),
|
||||
_ => (StatusCode::INTERNAL_SERVER_ERROR, self.to_string()),
|
||||
};
|
||||
(status, msg).into_response()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue