zulip/zerver
Greg Price 124d623d05 tornado/socket: Replace an ad-hoc error class with JsonableError.
The one purpose this exception was serving was to carry a message
in `msg`.  We can do that with `JsonableError`, and as a bonus replace
a repetition of the familiar "'result': 'error', ..." JSON pattern
with a call to a common implementation.

Also wrap the error messages for translation -- we hadn't been doing
that, oops.  Our linter notices that issue now that it's the familiar
JsonableError class.

There's one other potential change in behavior here: this
except-clause might now catch a JsonableError raised from some other
code.  That seems like a bonus, if so; the handler isn't doing
anything actually specific to this code, and the more exceptions it
successfully turns into proper error responses to the client and lines
in the log, the better.
2017-07-24 16:41:22 -07:00
..
fixtures markdown.js: Move markdown.js test to bugdown-data.json. 2017-07-18 12:56:47 -07:00
lib JsonErrorHandler: Take advantage of the new JsonableError structured data. 2017-07-24 16:41:22 -07:00
management tornado: Move setup_tornado_rabbitmq to application.py 2017-07-21 09:55:25 +05:00
migrations mypy: Fix incorrect mypy annotation in migration. 2017-07-18 12:56:23 -07:00
templatetags tidying: Combine multiple 'import typing' lines onto one line. 2017-07-16 16:43:21 -07:00
tests JsonableError: Optionally carry error codes and structured data. 2017-07-24 16:41:22 -07:00
tornado tornado/socket: Replace an ad-hoc error class with JsonableError. 2017-07-24 16:41:22 -07:00
views JsonableError: Optionally carry error codes and structured data. 2017-07-24 16:41:22 -07:00
webhooks webhooks/updown: Fix a JsonableError to provide a real error message. 2017-07-24 16:41:22 -07:00
worker outgoing webhooks: Consolidate interfaces into lib/outgoing_webhook.py 2017-07-24 14:10:14 -07:00
__init__.py
apps.py Add notifications on new logins to Zulip. 2017-03-25 16:50:52 -07:00
context_processors.py settings: Change all uses of ZULIP_ADMINISTRATOR to FromAddress.SUPPORT. 2017-07-05 15:33:01 -07:00
decorator.py exceptions: Move zerver/exceptions.py under zerver/lib/. 2017-07-24 16:41:22 -07:00
filters.py mypy: Added Dict, List and Set imports. 2017-03-04 14:33:44 -08:00
forms.py JsonableError: Rename message from `error` to `msg`. 2017-07-24 16:41:22 -07:00
logging_handlers.py logging_handlers: Fix tracebacks being emailed in subject lines. 2017-04-25 18:55:11 -07:00
middleware.py JsonErrorHandler: Take advantage of the new JsonableError structured data. 2017-07-24 16:41:22 -07:00
models.py Add outgoing webhook interface for Slack. 2017-07-24 14:10:14 -07:00
signals.py emails: Add to_user_id argument to send_email. 2017-07-16 16:56:39 -07:00
static_header.txt
storage.py pep8: Add compliance with rule E261 to storage.py. 2017-05-07 23:21:50 -07:00