fix: logger error
This commit is contained in:
1 parent
fe0103ab64
commit
cb6e4656d5
2 files changed
+2
-2
No files matched your search
+1
-1
@@ -62,7 +62,7 @@ async def chat_completions(
|
||||
return result
|
||||
|
||||
except GrokApiException as e:
|
||||
logger.error(f"[Chat] Grok API错误: {str(e)}", extra={"details": e.details})
|
||||
logger.error(f"[Chat] Grok API错误: {str(e)} - 详情: {e.details}")
|
||||
raise HTTPException(
|
||||
status_code=500,
|
||||
detail={
|
||||
|
||||
@@ -101,7 +101,7 @@ async def grok_api_exception_handler(_: Request, exc: GrokApiException) -> JSONR
|
||||
)
|
||||
|
||||
|
||||
async def global_exception_handler(_: Request) -> JSONResponse:
|
||||
async def global_exception_handler(_: Request, exc: Exception) -> JSONResponse:
|
||||
"""处理未捕获异常"""
|
||||
return JSONResponse(
|
||||
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
|
||||
|
||||
Reference in new issue
Block a user