pub(crate) type HttpResult = Result; pub(crate) struct Error { message: String, status: axum::http::StatusCode, } impl Error { pub(crate) fn internal() -> Self { Self { message: String::from("Internal server error"), status: axum::http::StatusCode::INTERNAL_SERVER_ERROR, } } } impl axum::response::IntoResponse for Error { fn into_response(self) -> axum::response::Response { (self.status, self.message).into_response() } }