From 8fe649cb5f12f990ae067d6c80293c0dd241731c Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Thu, 18 Mar 2021 12:12:46 +0100 Subject: chore: add git error type and equals macro --- src/errors.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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, } } -- cgit v1.2.3-18-g5258