异常修复
This commit is contained in:
parent
10ea077735
commit
13e124c02a
@ -65,9 +65,9 @@ def register_exception(app: FastAPI):
|
|||||||
# 打印栈信息,方便追踪排查异常
|
# 打印栈信息,方便追踪排查异常
|
||||||
logger.exception(exc)
|
logger.exception(exc)
|
||||||
return JSONResponse(
|
return JSONResponse(
|
||||||
status_code=200,
|
status_code=exc.status_code,
|
||||||
content={
|
content={
|
||||||
"code": status.HTTP_400_BAD_REQUEST,
|
"code": exc.status_code,
|
||||||
"message": exc.detail,
|
"message": exc.detail,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user