mirror of
https://github.com/snailyp/gemini-balance.git
synced 2026-09-06 16:16:37 +08:00
fix: 修复异步请求读取错误内容的方法
This commit is contained in:
@@ -335,7 +335,7 @@ class ChatService:
|
|||||||
"POST", stream_url, json=payload
|
"POST", stream_url, json=payload
|
||||||
) as async_response:
|
) as async_response:
|
||||||
if async_response.status_code != 200:
|
if async_response.status_code != 200:
|
||||||
error_content = await async_response.read()
|
error_content = await async_response.aread()
|
||||||
error_msg = error_content.decode("utf-8")
|
error_msg = error_content.decode("utf-8")
|
||||||
logger.error(
|
logger.error(
|
||||||
f"API error: {async_response.status_code}, {error_msg}"
|
f"API error: {async_response.status_code}, {error_msg}"
|
||||||
|
|||||||
Reference in New Issue
Block a user