Fix json_unhandled_exception handling of JsonableError.

(imported from commit 16ed6c213cbda3b60a16a01af32c56d6802b7acc)
This commit is contained in:
Tim Abbott
2013-12-13 18:11:17 -05:00
parent 14a5c6bf66
commit 7800a34d84

View File

@@ -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()