diff options
author | Santo Cariotti <santo@dcariotti.me> | 2021-03-18 12:12:46 +0100 |
---|---|---|
committer | Santo Cariotti <santo@dcariotti.me> | 2021-03-18 12:12:46 +0100 |
commit | 8fe649cb5f12f990ae067d6c80293c0dd241731c (patch) | |
tree | f29275f1bad13008938a7c442f0f6516e3d821d0 | |
parent | 86881759551b95da38bb763106cf6deb95b0be26 (diff) |
chore: add git error type and equals macro
-rw-r--r-- | src/errors.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/errors.rs b/src/errors.rs index 8140cfe..1efb082 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -4,11 +4,12 @@ use serde::Serialize; use std::fmt; use tokio_postgres::error::Error; -#[derive(Debug)] +#[derive(Debug, Eq, PartialEq)] pub enum AppErrorType { DbError, NotFoundError, AuthorizationError, + GitError, } #[derive(Debug)] @@ -72,6 +73,7 @@ impl ResponseError for AppError { AppErrorType::DbError => StatusCode::INTERNAL_SERVER_ERROR, AppErrorType::NotFoundError => StatusCode::NOT_FOUND, AppErrorType::AuthorizationError => StatusCode::UNAUTHORIZED, + AppErrorType::GitError => StatusCode::BAD_REQUEST, } } |