mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
Fix json_unhandled_exception handling of JsonableError.
(imported from commit 16ed6c213cbda3b60a16a01af32c56d6802b7acc)
This commit is contained in:
@@ -3,7 +3,7 @@ from __future__ import absolute_import
|
||||
from django.views.decorators.csrf import csrf_exempt, csrf_protect
|
||||
|
||||
from zerver.decorator import authenticated_json_view, authenticated_rest_api_view, \
|
||||
process_as_post
|
||||
process_as_post, JsonableError
|
||||
from zerver.lib.response import json_method_not_allowed, json_unauthorized, json_unhandled_exception
|
||||
from django.http import HttpResponseRedirect
|
||||
from django.conf import settings
|
||||
@@ -82,7 +82,9 @@ def rest_dispatch(request, globals_list, **kwargs):
|
||||
|
||||
try:
|
||||
return target_function(request, **kwargs)
|
||||
except:
|
||||
except JsonableError:
|
||||
raise
|
||||
except Exception:
|
||||
logging.exception('Uncaught exception in rest_dispatch')
|
||||
return json_unhandled_exception()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user