Skip to content

Commit

Permalink
Move try to higher level
Browse files Browse the repository at this point in the history
  • Loading branch information
pvannierop committed Jul 8, 2024
1 parent 1712147 commit 2335d6a
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ public EmailNotificationTransmitter(
@Override
public void send(Notification notification) throws EmailMessageTransmitException {
if (notification.isEmailEnabled()) {
if (notification.getUser().getEmailAddress() == null || notification.getUser().getEmailAddress().isBlank()) {
log.warn("Could not transmit a notification via email because subject {} has no email address.",
notification.getUser().getSubjectId());
return;
}
try {
if (notification.getUser().getEmailAddress() == null || notification.getUser().getEmailAddress().isBlank()) {
log.warn("Could not transmit a notification via email because subject {} has no email address.",
notification.getUser().getSubjectId());
return;
}
emailSender.send(createEmailFromNotification(notification));
} catch (Exception e) {
log.error("Could not transmit a notification via email", e);
Expand Down

0 comments on commit 2335d6a

Please sign in to comment.