zulip/zerver
Greg Price 53c57cf002 errors: Include request info on error mails for JSON routes too.
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.
2018-03-01 15:12:32 -08:00
..
fixtures fixtures: Update description in zerver_realm_skeleton.json. 2018-02-21 08:58:27 -08:00
lib antispam: Don't let new accounts in open realms immediately send invites. 2018-03-01 14:56:19 -08:00
management django-2.0: Don't assign directly to Many-to-Many field. 2018-03-01 08:49:35 -08:00
migrations models: Change description attribute of user group to textfield. 2018-03-01 11:27:26 -08:00
templatetags mypy: Tweak a bit of syntax to avoid a mypy bug. 2018-02-09 19:43:27 -08:00
tests django-2.0: Don't assign directly to Many-to-Many field. 2018-03-01 08:49:35 -08:00
tornado mypy: Clarify valid types in tornado views via new variable. 2018-02-13 11:40:52 -08:00
views django-2.0: Don't assign directly to Many-to-Many field. 2018-03-01 08:49:35 -08:00
webhooks integrations: Add documentation for Front. 2018-02-28 16:18:19 -05:00
worker Exclude QueueProcessingWorker.stop() from coverage test. 2018-02-28 12:31:38 -08:00
__init__.py
apps.py zerver: Use Python 3 syntax for typing. 2017-11-28 16:49:36 -08:00
context_processors.py integrations/email: Render settings.EMAIL_GATEWAY_EXAMPLE correctly. 2018-01-22 18:05:20 -05:00
decorator.py decorators: Fix email check in access_user_by_api_key case insensitive. 2018-01-23 10:04:03 -08:00
filters.py zerver: Use Python 3 syntax for typing. 2017-11-28 16:49:36 -08:00
forms.py subdomain: Check for invalid characters before length. 2018-02-19 10:45:17 -08:00
logging_handlers.py Fix mypy error in AdminNotifyHandler.emit(). 2017-12-22 15:02:18 -05:00
middleware.py errors: Include request info on error mails for JSON routes too. 2018-03-01 15:12:32 -08:00
models.py models: Change description attribute of user group to textfield. 2018-03-01 11:27:26 -08:00
signals.py emails: Fix notify_new_login emails have unserializable context. 2017-12-22 16:34:18 -05:00
static_header.txt
storage.py mypy: Improve typing for ManifestStaticFilesStorage monkeypatch. 2017-12-08 19:00:18 -08:00