Fix exception handling bug

This commit is contained in:
Iam54r1n4
2025-02-04 16:35:22 +00:00
parent 360e6ac4ba
commit cb82cc9fd4

View File

@ -12,7 +12,7 @@ def setup_exception_handler(app: FastAPI):
'''
Setup exception handler for FastAPI.
'''
@app.exception_handler(Exception)
@app.exception_handler(HTTPException)
async def http_exception_handler(request: Request, exc: HTTPException): # type: ignore
return JSONResponse(
status_code=exc.status_code,