TurboGears / tg2

Python web framework with full-stack layer implemented on top of a microframework core with support for SQL DBMS, MongoDB and Pluggable Applications
http://www.turbogears.org/
Other
803 stars 77 forks source link

Quick started App won't send tracebacks to Sentry #94

Closed italorossi closed 6 years ago

italorossi commented 6 years ago

I just created a new minimun app and enabled trace_errors with Sentry. When an exception is raised SentryReporter calls self.client.captureException(data=data) and inside captureException Sentry tried to get sys.exc_info() but a tuple with three None objects is returned leading to this error:

Error while reporting exception with <backlash.tracing.reporters.sentry.SentryReporter object at 0x106936290>
Traceback (most recent call last):
  File "/Users/italorossi/envs/tg/lib/python2.7/site-packages/backlash/tracing/reporters/sentry.py", line 36, in report
    self.client.captureException(data=data)
  File "/Users/italorossi/envs/tg/lib/python2.7/site-packages/raven/base.py", line 818, in captureException
    'raven.events.Exception', exc_info=exc_info, **kwargs)
  File "/Users/italorossi/envs/tg/lib/python2.7/site-packages/raven/base.py", line 629, in capture
    elif not self.should_capture(exc_info):
  File "/Users/italorossi/envs/tg/lib/python2.7/site-packages/raven/base.py", line 822, in should_capture
    exc_name = '%s.%s' % (exc_type.__module__, exc_type.__name__)
AttributeError: 'NoneType' object has no attribute '__module__'

What I can see is that backlash has the exception on the traceback object but somehow sys.exc_info was 'cleared' before calling raven client.

italorossi commented 6 years ago

fixed in backlash 0.1.3