From 59c8894053c070a605c96af5f854cda425df7f3d Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 6 May 2015 06:51:27 +0200 Subject: [PATCH] Log exceptions when sending emails --- src/main/java/net/pterodactylus/rhynodge/actions/EmailAction.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/pterodactylus/rhynodge/actions/EmailAction.java b/src/main/java/net/pterodactylus/rhynodge/actions/EmailAction.java index cedde47..4dfece0 100644 --- a/src/main/java/net/pterodactylus/rhynodge/actions/EmailAction.java +++ b/src/main/java/net/pterodactylus/rhynodge/actions/EmailAction.java @@ -37,6 +37,7 @@ import net.pterodactylus.rhynodge.output.Output; import com.google.common.annotations.VisibleForTesting; import com.sun.mail.smtp.SMTPTransport; +import org.apache.log4j.Logger; /** * {@link Action} implementation that sends an email containing the triggering @@ -46,6 +47,8 @@ import com.sun.mail.smtp.SMTPTransport; */ public class EmailAction implements Action { + private static final Logger logger = Logger.getLogger(EmailAction.class); + /** The email address of the sender. */ private final String sender; @@ -110,7 +113,7 @@ public class EmailAction implements Action { } transport.sendMessage(message, message.getAllRecipients()); } catch (MessagingException me1) { - /* swallow. */ + logger.error("Could not send email!", me1); } } -- 2.7.4