update
This commit is contained in:
parent
c7fcfc7443
commit
8d7a37ed35
10
app/main.py
10
app/main.py
@ -70,10 +70,7 @@ async def validation_exception_handler(request, exc):
|
|||||||
logging.exception(f"请求参数错误: {str(exc)}")
|
logging.exception(f"请求参数错误: {str(exc)}")
|
||||||
return CustomJSONResponse(
|
return CustomJSONResponse(
|
||||||
status_code=400,
|
status_code=400,
|
||||||
content=error_response(
|
content=str(exc)
|
||||||
code=400,
|
|
||||||
message=str(exc)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
@app.exception_handler(HTTPException)
|
@app.exception_handler(HTTPException)
|
||||||
@ -81,8 +78,5 @@ async def http_exception_handler(request, exc):
|
|||||||
logging.exception(f"HTTP异常: {str(exc)}")
|
logging.exception(f"HTTP异常: {str(exc)}")
|
||||||
return CustomJSONResponse(
|
return CustomJSONResponse(
|
||||||
status_code=exc.status_code,
|
status_code=exc.status_code,
|
||||||
content=error_response(
|
content=str(exc)
|
||||||
code=exc.status_code,
|
|
||||||
message=exc.detail
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
Loading…
Reference in New Issue
Block a user