json_error: Completely remove json_error.

This completes the migration from `return json_error` to
`raise JsonableError`.
This commit is contained in:
PIG208
2021-07-04 16:00:55 +08:00
committed by Tim Abbott
parent dbf886dfce
commit 8b9011dff8
7 changed files with 8 additions and 25 deletions

View File

@@ -170,12 +170,11 @@ from django.utils.translation import gettext as _
```
Zulip expects all the error messages to be translatable as well. To
ensure this, the error message passed to `json_error` and
`JsonableError` should always be a literal string enclosed by `_()`
ensure this, the error message passed to `JsonableError`
should always be a literal string enclosed by `_()`
function, e.g.:
```
json_error(_('English text'))
JsonableError(_('English text'))
```