Fix exception handling bug
This commit is contained in:
@ -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,
|
||||
|
||||
Reference in New Issue
Block a user