mirror of https://github.com/zulip/zulip.git
53c57cf002
When our code raises an exception and Django converts it to a 500 response (in django.core.handlers.exception.handle_uncaught_exception), it attaches the request to the log record, and we use this in our AdminNotifyHandler to include data like the user and the URL path in the error email sent to admins. On this line, when our code raises an exception but we've decided (in `TagRequests`) to format any errors as JSON errors, we suppress the exception so we have to generate the log record ourselves. Attach the request here, just like Django does when we let it do the job. This still isn't an awesome solution, in that there are lots of other places where we call `logging.error` or `logging.exception` while inside a request; this just covers one of them. This is one of the most common, though, so it's a start. |
||
---|---|---|
.. | ||
fixtures | ||
lib | ||
management | ||
migrations | ||
templatetags | ||
tests | ||
tornado | ||
views | ||
webhooks | ||
worker | ||
__init__.py | ||
apps.py | ||
context_processors.py | ||
decorator.py | ||
filters.py | ||
forms.py | ||
logging_handlers.py | ||
middleware.py | ||
models.py | ||
signals.py | ||
static_header.txt | ||
storage.py |