Sent got_request_exception signal before handle_uncaught_exception
In some cases (notably Python 3), when handle_uncaught_exception was itself raising an exception, the got_request_exception was storing the latter exception instead of the original exception.
This commit is contained in:
parent
31ae103a15
commit
64531df5df
|
@ -152,10 +152,8 @@ class BaseHandler(object):
|
|||
callback, param_dict = resolver.resolve404()
|
||||
response = callback(request, **param_dict)
|
||||
except:
|
||||
try:
|
||||
response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
|
||||
finally:
|
||||
signals.got_request_exception.send(sender=self.__class__, request=request)
|
||||
response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
|
||||
except exceptions.PermissionDenied:
|
||||
logger.warning(
|
||||
'Forbidden (Permission denied): %s', request.path,
|
||||
|
@ -167,12 +165,10 @@ class BaseHandler(object):
|
|||
callback, param_dict = resolver.resolve403()
|
||||
response = callback(request, **param_dict)
|
||||
except:
|
||||
try:
|
||||
response = self.handle_uncaught_exception(request,
|
||||
resolver, sys.exc_info())
|
||||
finally:
|
||||
signals.got_request_exception.send(
|
||||
sender=self.__class__, request=request)
|
||||
response = self.handle_uncaught_exception(request,
|
||||
resolver, sys.exc_info())
|
||||
except SystemExit:
|
||||
# Allow sys.exit() to actually exit. See tickets #1023 and #4701
|
||||
raise
|
||||
|
|
Loading…
Reference in New Issue