(request: Request, exc: HTTPException)
| 9 | |
| 10 | |
| 11 | async def http_exception_handler(request: Request, exc: HTTPException) -> Response: |
| 12 | headers = getattr(exc, "headers", None) |
| 13 | if not is_body_allowed_for_status_code(exc.status_code): |
| 14 | return Response(status_code=exc.status_code, headers=headers) |
| 15 | return JSONResponse( |
| 16 | {"detail": exc.detail}, status_code=exc.status_code, headers=headers |
| 17 | ) |
| 18 | |
| 19 | |
| 20 | async def request_validation_exception_handler( |
no test coverage detected
searching dependent graphs…