feat: define campaign doesnt exist error type

This commit is contained in:
Aravinth Manivannan 2023-01-24 23:00:08 +05:30
parent 1423fa73d9
commit 9f0d38ab07
Signed by: realaravinth
GPG Key ID: AD9F0F08E855ED88
1 changed files with 5 additions and 0 deletions

View File

@ -76,6 +76,9 @@ pub enum ServiceError {
PasswordTooLong,
#[display(fmt = "Passwords don't match")]
PasswordsDontMatch,
#[display(fmt = "Campaign doesn't exist")]
CampaignDoesntExist,
}
#[derive(Serialize, Deserialize)]
@ -118,6 +121,8 @@ impl ResponseError for ServiceError {
ServiceError::PasswordTooShort => StatusCode::BAD_REQUEST,
ServiceError::PasswordTooLong => StatusCode::BAD_REQUEST,
ServiceError::PasswordsDontMatch => StatusCode::BAD_REQUEST,
ServiceError::CampaignDoesntExist => StatusCode::NOT_FOUND,
}
}
}