mirror of https://github.com/zulip/zulip.git
124d623d05
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. |
||
---|---|---|
.. | ||
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 |