diff options
Diffstat (limited to 'src/error.rs')
-rw-r--r-- | src/error.rs | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/src/error.rs b/src/error.rs deleted file mode 100644 index 730f99a..0000000 --- a/src/error.rs +++ /dev/null @@ -1,26 +0,0 @@ -use axum::{ - http::StatusCode, - response::{IntoResponse, Response}, -}; - -#[derive(Debug)] -pub struct AppError(anyhow::Error); - -impl IntoResponse for AppError { - fn into_response(self) -> Response { - ( - StatusCode::INTERNAL_SERVER_ERROR, - format!("Something went wrong: {}", self.0), - ) - .into_response() - } -} - -impl<E> From<E> for AppError -where - E: Into<anyhow::Error>, -{ - fn from(err: E) -> Self { - Self(err.into()) - } -} |