Revert "Change email status to permanent-failure if SES raises InvalidParameterValue"

This reverts commit 51716fbaf8.

Instead of relying on catching SES errors we will convert all emails to
punycode before sending instead.
This commit is contained in:
Katie Smith
2019-08-12 13:51:24 +01:00
parent c99cd0d9a9
commit 355fb07eb2
2 changed files with 5 additions and 5 deletions

View File

@@ -9,7 +9,7 @@ from app.dao import notifications_dao
from app.dao.notifications_dao import update_notification_status_by_id
from app.delivery import send_to_providers
from app.exceptions import NotificationTechnicalFailureException
from app.models import NOTIFICATION_PERMANENT_FAILURE, NOTIFICATION_TECHNICAL_FAILURE
from app.models import NOTIFICATION_TECHNICAL_FAILURE
@notify_celery.task(bind=True, name="deliver_sms", max_retries=48, default_retry_delay=300)
@@ -47,8 +47,8 @@ def deliver_email(self, notification_id):
raise NoResultFound()
send_to_providers.send_email_to_provider(notification)
except InvalidEmailError as e:
current_app.logger.info(e)
update_notification_status_by_id(notification_id, NOTIFICATION_PERMANENT_FAILURE)
current_app.logger.exception(e)
update_notification_status_by_id(notification_id, 'technical-failure')
except Exception:
try:
current_app.logger.exception(