Skip to content

Commit

Permalink
#85 In case of exceptions, log the failed email
Browse files Browse the repository at this point in the history
  • Loading branch information
bbottema committed Aug 12, 2017
1 parent 354cb74 commit 3ab9698
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,14 @@ private void sendMailClosure(final Session session, final Email email) {
checkShutDownRunningProcesses();
}
} catch (final UnsupportedEncodingException e) {
LOGGER.error("Failed to send email:\n{}", email);
throw new MailSenderException(MailSenderException.INVALID_ENCODING, e);
} catch (final MessagingException e) {
LOGGER.error("Failed to send email:\n{}", email);
throw new MailSenderException(MailSenderException.GENERIC_ERROR, e);
} catch (final Exception e) {
LOGGER.error("Failed to send email:\n{}", email);
throw e;
}
}

Expand Down

0 comments on commit 3ab9698

Please sign in to comment.