Skip to content

Commit

Permalink
[JENKINS-16181] Jenkins does not try to resend a failed e-mail
Browse files Browse the repository at this point in the history
- Added handling where MessagingConnection is caused by a ConnectException. One retry with a delay of 10 sec is made.
  • Loading branch information
christiangalsterer committed Aug 23, 2014
1 parent 5a0f29b commit 531a923
Showing 1 changed file with 8 additions and 0 deletions.
Expand Up @@ -385,6 +385,14 @@ private boolean sendMail(ExtendedEmailPublisherContext context) {
debug(context.getListener().getLogger(), "SendFailedException message: " + e.getMessage());
break;
}
} catch (MessagingException e) {
if (e.getNextException() != null && (e.getNextException() instanceof ConnectException)) {
context.getListener().getLogger().println("Connection error sending email, retrying once more in 10 seconds...");
Thread.sleep(10000);
} else {
debug(context.getListener().getLogger(), "MessagingException message: " + e.getMessage());
break;
}
}
retries++;
if (retries > 1) {
Expand Down

0 comments on commit 531a923

Please sign in to comment.