]> git.ipfire.org Git - thirdparty/starlette.git/commitdiff
Adjust type of `exception_handlers` to allow async callable (#1423)
authorMichael Oliver <michaeloliver__@outlook.com>
Fri, 21 Jan 2022 11:59:59 +0000 (11:59 +0000)
committerGitHub <noreply@github.com>
Fri, 21 Jan 2022 11:59:59 +0000 (12:59 +0100)
starlette/applications.py

index 9f05dc286d9167105a238184436afec5aaf6a180..ab67925270e871602221a2b6201b83f3f9aff06b 100644 (file)
@@ -44,7 +44,10 @@ class Starlette:
         routes: typing.Sequence[BaseRoute] = None,
         middleware: typing.Sequence[Middleware] = None,
         exception_handlers: typing.Mapping[
-            typing.Any, typing.Callable[[Request, Exception], Response]
+            typing.Any,
+            typing.Callable[
+                [Request, Exception], typing.Union[Response, typing.Awaitable[Response]]
+            ],
         ] = None,
         on_startup: typing.Sequence[typing.Callable] = None,
         on_shutdown: typing.Sequence[typing.Callable] = None,