forked from orbit-oss/flask
Handle empty deque on errorhandler lookup.
After registering a custom errorhandler by exception class, raising any unhandled exception in a view function swallows the error and instead throws an `IndexError` on trying to look up the appropriate handler. This patch avoids the uninformative `IndexError` and preserves the original exception by looping until the deque of classes is empty, not forever.
This commit is contained in:
parent
0d19fa0a06
commit
348bf52188
2 changed files with 30 additions and 1 deletions
|
|
@ -1421,7 +1421,7 @@ class Flask(_PackageBoundObject):
|
|||
# __mro__
|
||||
done = set()
|
||||
|
||||
while True:
|
||||
while queue:
|
||||
cls = queue.popleft()
|
||||
if cls in done:
|
||||
continue
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue