From 29c3b7beeb7d3e1cd31f3b52bbe84a73b93af123 Mon Sep 17 00:00:00 2001 From: Yurii Motov Date: Fri, 25 Apr 2025 13:07:49 +0200 Subject: [PATCH] Made the exception handler function `async` in code example --- docs_src/handling_errors/tutorial008.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs_src/handling_errors/tutorial008.py b/docs_src/handling_errors/tutorial008.py index b05652647..fc227126a 100644 --- a/docs_src/handling_errors/tutorial008.py +++ b/docs_src/handling_errors/tutorial008.py @@ -18,7 +18,7 @@ class UnsupportedFileTypeError(HTTPException): @app.exception_handler((FileTooLargeError, UnsupportedFileTypeError)) -def custom_exception_handler(request: Request, exc: HTTPException): +async def custom_exception_handler(request: Request, exc: HTTPException): return JSONResponse( status_code=exc.status_code, content={"error": exc.detail, "hint": "Need help? Contact support@example.com"},