} else {
alertSender.sendEmails(stream, result);
}
} catch (TransportConfigurationException e) {
LOG.warn("Stream [{}] has alert receivers and is triggered, but email transport is not configured.", stream);
Notification notification = notificationService.buildNow()
.addNode(nodeId.toString())
.addType(Notification.Type.EMAIL_TRANSPORT_CONFIGURATION_INVALID)
.addSeverity(Notification.Severity.NORMAL)
.addDetail("stream_id", stream.getId())
.addDetail("exception", new ExceptionStringFormatter(e).toString());
notificationService.publishIfFirst(notification);
} catch (Exception e) {
LOG.error("Stream [" + stream + "] has alert receivers and is triggered, but sending emails failed", e);
Notification notification = notificationService.buildNow()
.addNode(nodeId.toString())
.addType(Notification.Type.EMAIL_TRANSPORT_FAILED)
.addSeverity(Notification.Severity.NORMAL)
.addDetail("stream_id", stream.getId())
.addDetail("exception", e.toString() + " (" + e.getCause().toString() + "");