summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2021-03-18 12:12:46 +0100
committerSanto Cariotti <santo@dcariotti.me>2021-03-18 12:12:46 +0100
commit8fe649cb5f12f990ae067d6c80293c0dd241731c (patch)
treef29275f1bad13008938a7c442f0f6516e3d821d0 /src
parent86881759551b95da38bb763106cf6deb95b0be26 (diff)
chore: add git error type and equals macro
Diffstat (limited to 'src')
-rw-r--r--src/errors.rs4
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,
}
}