mirror of https://github.com/zulip/zulip.git
dcbb2a78ca
JsonableError has two major benefits over json_error: * It can be raised from anywhere in the codebase, rather than being a return value, which is much more convenient for refactoring, as one doesn't potentially need to change error handling style when extracting a bit of view code to a function. * It is guaranteed to contain the `code` property, which is helpful for API consistency. Various stragglers are not updated because JsonableError requires subclassing in order to specify custom data or HTTP status codes. |
||
---|---|---|
.. | ||
lib | ||
management | ||
migrations | ||
tests | ||
__init__.py | ||
models.py | ||
urls.py | ||
views.py |