From 3a4729d4655a429971f977e3d18dec792d6d2ecc Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Mon, 22 Aug 2022 15:39:11 +0200 Subject: Rename `Error` to `AppError` --- server/src/errors.rs | 6 +++--- server/src/main.rs | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/server/src/errors.rs b/server/src/errors.rs index b5f124b..cf59d0c 100644 --- a/server/src/errors.rs +++ b/server/src/errors.rs @@ -5,14 +5,14 @@ use axum::{ }; use serde_json::json; -pub enum Error { +pub enum AppError { Generic, } -impl IntoResponse for Error { +impl IntoResponse for AppError { fn into_response(self) -> Response { let (status, error_message) = match self { - Error::Generic => ( + AppError::Generic => ( StatusCode::INTERNAL_SERVER_ERROR, "Generic error, can't find why", ), diff --git a/server/src/main.rs b/server/src/main.rs index 810e202..2f4a727 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -1,3 +1,4 @@ +mod db; mod errors; mod logger; @@ -50,7 +51,7 @@ async fn create_app() -> Router { } // Example root which says hi -async fn hej() -> Result, errors::Error> { +async fn hej() -> Result, errors::AppError> { Ok(Json(Hej::new("hej verden".to_string()))) } -- cgit v1.2.3-18-g5258