Skip to content
This repository has been archived by the owner on Jun 11, 2018. It is now read-only.

DjangoClient.capture: simplify check fox exc_info #187

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions opbeat/contrib/django/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,9 @@ def capture(self, event_type, request=None, **kwargs):
if is_http_request:
data.update(self.get_data_from_request(request))

if kwargs.get('exc_info'):
exc_value = kwargs['exc_info'][1]
exc_info = kwargs.get('exc_info')
if exc_info:
exc_value = exc_info[1]
# As of r16833 (Django) all exceptions may contain a ``django_template_source`` attribute (rather than the
# legacy ``TemplateSyntaxError.source`` check) which describes template information.
if hasattr(exc_value, 'django_template_source') or ((isinstance(exc_value, TemplateSyntaxError) and
Expand Down