diff --git a/gracedb/alerts/email.py b/gracedb/alerts/email.py index 0ffa1f3b7bfae56bc3b21a554afaa04cdd0d18b5..c79aa8385c1bf35c2df55f2c5fc5f18c41154b9b 100644 --- a/gracedb/alerts/email.py +++ b/gracedb/alerts/email.py @@ -152,4 +152,10 @@ def issue_email_alerts(event_or_superevent, alert_type, recipients, # Send email messages backend = get_connection() - backend.send_messages(messages) + try: + backend.send_messages(messages) + except Exception as e: + # If there is a problem sending emails just log it and continue since + # email alerts aren't mission critical. But we log the information + # since we want to understand what is happening. + logger.error('Error sending email alerts: {e}'.format(e=e))