diff options
-rw-r--r-- | src/errors.rs | 2 |
1 files changed, 2 insertions, 0 deletions
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, } } |