Skip to content
This repository was archived by the owner on Oct 23, 2023. It is now read-only.
This repository was archived by the owner on Oct 23, 2023. It is now read-only.

KeyError: '__sentry__' in create_from_text #8

@cabacon

Description

@cabacon

Traceback (most recent call last):
File "/usr/local/lib/python2.6/dist-packages/gunicorn-0.13.1-py2.6.egg/gunicorn/workers/sync.py", line 97, in handle_request
respiter = self.wsgi(environ, resp.start_response)
File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/wsgi.py", line 252, in call
response = middleware_method(request, response)
File "/usr/local/lib/python2.6/dist-packages/raven-0.5-py2.6.egg/raven/contrib/django/middleware.py", line 21, in process_response
result = client.create_from_text('Http 404', request=request, level=logging.INFO, logger='http404')
File "/usr/local/lib/python2.6/dist-packages/raven-0.5-py2.6.egg/raven/base.py", line 263, in create_from_text
**kwargs
File "/usr/local/lib/python2.6/dist-packages/raven-0.5-py2.6.egg/raven/contrib/django/init.py", line 58, in process
kwargs['data']['sentry']['user'] = user_info
KeyError: 'sentry'

You have, on line 35
if 'data' not in kwargs:
kwargs['data'] = {}

But then, on line 58, you reference
kwargs['data']['sentry']['user'] = user_info

You need to set
kwargs['data']['sentry'] = {}
also, before using it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions