From 4b25bf3976b787bec97151c5c284f2fdf1f9c255 Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Sun, 14 Mar 2021 21:54:22 +0100 Subject: feat(errors): add authorizationerror in list --- src/errors.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/errors.rs') diff --git a/src/errors.rs b/src/errors.rs index 07df840..8140cfe 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -8,6 +8,7 @@ use tokio_postgres::error::Error; pub enum AppErrorType { DbError, NotFoundError, + AuthorizationError, } #[derive(Debug)] @@ -70,6 +71,7 @@ impl ResponseError for AppError { match self.error_type { AppErrorType::DbError => StatusCode::INTERNAL_SERVER_ERROR, AppErrorType::NotFoundError => StatusCode::NOT_FOUND, + AppErrorType::AuthorizationError => StatusCode::UNAUTHORIZED, } } -- cgit v1.2.3-18-g5258