diff --git a/opwen_email_server/services/sendgrid.py b/opwen_email_server/services/sendgrid.py index 831ae7ad..d1d7c6db 100644 --- a/opwen_email_server/services/sendgrid.py +++ b/opwen_email_server/services/sendgrid.py @@ -1,6 +1,5 @@ from mimetypes import guess_type from typing import Callable -from urllib.error import URLError from cached_property import cached_property from requests import post as http_post @@ -47,7 +46,7 @@ def _send_email(self, email: Mail, email_id: str) -> bool: request = email.get() try: status = self._client(request) - except URLError as ex: + except Exception as ex: status = getattr(ex, 'code', -1) self.log_exception(ex, 'error sending email %s:%r', email_id, request)