forked from orbit-oss/flask
Reduce unnecessary function calls.
When propagate exceptions, the function call of "_find_error_handler" makes no sense.
This commit is contained in:
parent
0b7a74dda3
commit
aa7e15dcba
1 changed files with 1 additions and 2 deletions
|
|
@ -1728,9 +1728,7 @@ class Flask(_PackageBoundObject):
|
||||||
.. versionadded:: 0.3
|
.. versionadded:: 0.3
|
||||||
"""
|
"""
|
||||||
exc_type, exc_value, tb = sys.exc_info()
|
exc_type, exc_value, tb = sys.exc_info()
|
||||||
|
|
||||||
got_request_exception.send(self, exception=e)
|
got_request_exception.send(self, exception=e)
|
||||||
handler = self._find_error_handler(InternalServerError())
|
|
||||||
|
|
||||||
if self.propagate_exceptions:
|
if self.propagate_exceptions:
|
||||||
# if we want to repropagate the exception, we can attempt to
|
# if we want to repropagate the exception, we can attempt to
|
||||||
|
|
@ -1743,6 +1741,7 @@ class Flask(_PackageBoundObject):
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
self.log_exception((exc_type, exc_value, tb))
|
self.log_exception((exc_type, exc_value, tb))
|
||||||
|
handler = self._find_error_handler(InternalServerError())
|
||||||
if handler is None:
|
if handler is None:
|
||||||
return InternalServerError()
|
return InternalServerError()
|
||||||
return self.finalize_request(handler(e), from_error_handler=True)
|
return self.finalize_request(handler(e), from_error_handler=True)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue