From 37baf0ce8e17be565750af34125d49c1b921105a Mon Sep 17 00:00:00 2001 From: Tully Rankin Date: Mon, 14 May 2018 12:01:50 -0400 Subject: [PATCH] Fix incorrect error handler being called. --- flask/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flask/app.py b/flask/app.py index 87c59003..36899e5c 100644 --- a/flask/app.py +++ b/flask/app.py @@ -1334,7 +1334,7 @@ class Flask(_PackageBoundObject): :type code_or_exception: int|T<=Exception :type f: callable """ - if isinstance(code_or_exception, HTTPException): # old broken behavior + if not issubclass(code_or_exception, (HTTPException, Exception)): raise ValueError( 'Tried to register a handler for an exception instance {0!r}.' ' Handlers can only be registered for exception classes or'