mirror of
https://git.verdigado.com/NB-Public/simple-wkd.git
synced 2024-12-05 03:12:50 +01:00
Add special mail when failing to send mail
This commit is contained in:
parent
ab10c7f9e9
commit
7cef05a7f9
2 changed files with 7 additions and 2 deletions
|
@ -77,6 +77,8 @@ pub fn send_confirmation_email(address: &str, action: &Action, token: &str) -> R
|
|||
|
||||
let email = log_err!(email, warn)?;
|
||||
|
||||
log_err!(MAILER.send(&email), warn)?;
|
||||
Ok(())
|
||||
match log_err!(MAILER.send(&email), warn){
|
||||
Ok(_) => Ok(()),
|
||||
Err(_) => Err(SpecialErrors::MailErr)?
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,6 +44,8 @@ pub enum SpecialErrors {
|
|||
InexistingUser,
|
||||
#[error("The key is either expired or uses an obsolete cipher!")]
|
||||
InvalidCert,
|
||||
#[error("Error while sending email")]
|
||||
MailErr,
|
||||
#[error("Could not parse keyblock")]
|
||||
MalformedCert,
|
||||
#[error("Could not parse user email: malformed email")]
|
||||
|
@ -94,6 +96,7 @@ impl ResponseError for CompatErr {
|
|||
SpecialErrors::InexistingUser => StatusCode::NOT_FOUND,
|
||||
SpecialErrors::InvalidCert => StatusCode::BAD_REQUEST,
|
||||
SpecialErrors::EmailMissing => StatusCode::BAD_REQUEST,
|
||||
SpecialErrors::MailErr => StatusCode::INTERNAL_SERVER_ERROR,
|
||||
SpecialErrors::MalformedCert => StatusCode::BAD_REQUEST,
|
||||
SpecialErrors::MalformedEmail => StatusCode::BAD_REQUEST,
|
||||
SpecialErrors::MissingFile => StatusCode::NOT_FOUND,
|
||||
|
|
Loading…
Reference in a new issue