diff options
author | Santo Cariotti <santo@dcariotti.me> | 2021-03-14 21:54:22 +0100 |
---|---|---|
committer | Santo Cariotti <santo@dcariotti.me> | 2021-03-14 21:54:22 +0100 |
commit | 4b25bf3976b787bec97151c5c284f2fdf1f9c255 (patch) | |
tree | eab480dce50c284b6e160edc7e55879b91f77c2f /src | |
parent | bf6c4bd75168671a5a0e53f7390ebd4796a6bd57 (diff) |
feat(errors): add authorizationerror in list
Diffstat (limited to 'src')
-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, } } |