Skip to content

Commit

Permalink
Support overriding default exception reporter
Browse files Browse the repository at this point in the history
As of Django 3.1 it is possible to override which exception report to
use:
https://docs.djangoproject.com/en/4.1/releases/3.1/#error-reporting

Relevant issue:
#100
  • Loading branch information
stianjensen authored and lamby committed Sep 2, 2022
1 parent 4a6d657 commit a783d92
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions django_slack/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import logging

from django.conf import settings
from django.views.debug import ExceptionReporter
from django.views.debug import get_exception_reporter_class

from . import slack_message

Expand Down Expand Up @@ -49,7 +49,7 @@ def emit(self, record):
else:
exc_info = (None, record.getMessage(), None)

reporter = ExceptionReporter(request, is_email=True, *exc_info)
reporter = get_exception_reporter_class(request)(request, is_email=True, *exc_info)

try:
tb = reporter.get_traceback_text()
Expand Down

0 comments on commit a783d92

Please sign in to comment.