Skip to content
Snippets Groups Projects
Commit 9015d7a5 authored by florimondmanca's avatar florimondmanca
Browse files

fix error logging

parent 9dfa70d1
No related branches found
No related tags found
No related merge requests found
"""Mails app signals."""
from django.dispatch import Signal, receiver
from python_http_client.exceptions import HTTPError
from logs import get_logger
......@@ -29,7 +28,4 @@ def log_app_disabled(sender, subject, recipient_list, **kwargs):
@receiver(failed)
def log_failed(sender, exception, **kwargs):
"""Log an exception that occurred during a mail delivery."""
if isinstance(exception, HTTPError):
logger.exception(exception.read())
else:
logger.exception(exception)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment