Skip to content

Commit

Permalink
Increase sendgrid exception catching (#199)
Browse files Browse the repository at this point in the history
  • Loading branch information
c-w authored May 27, 2019
1 parent 4ecb16b commit 205d1f3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions opwen_email_server/services/sendgrid.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 205d1f3

Please sign in to comment.