Bug fix: Some non-standard forms of error return are not caught (#1877)

This commit is contained in:
Menghuan1918 2024-07-01 20:35:49 +08:00 committed by GitHub
parent 18d3245fc9
commit 6cd2d80dfd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -44,7 +44,8 @@ def decode_chunk(chunk):
try:
chunk = json.loads(chunk[6:])
except:
finish_reason = "JSON_ERROR"
respose = "API_ERROR"
finish_reason = chunk
# 错误处理部分
if "error" in chunk:
respose = "API_ERROR"