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

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,
}
}
}