Made the exception handler function `async` in code example

This commit is contained in:
Yurii Motov 2025-04-25 13:07:49 +02:00
parent 16a1b659d5
commit 29c3b7beeb
1 changed files with 1 additions and 1 deletions

View File

@ -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"},