Bug fix: Some non-standard forms of error return are not caught (#1877)
This commit is contained in:
@@ -44,7 +44,8 @@ def decode_chunk(chunk):
|
|||||||
try:
|
try:
|
||||||
chunk = json.loads(chunk[6:])
|
chunk = json.loads(chunk[6:])
|
||||||
except:
|
except:
|
||||||
finish_reason = "JSON_ERROR"
|
respose = "API_ERROR"
|
||||||
|
finish_reason = chunk
|
||||||
# 错误处理部分
|
# 错误处理部分
|
||||||
if "error" in chunk:
|
if "error" in chunk:
|
||||||
respose = "API_ERROR"
|
respose = "API_ERROR"
|
||||||
|
|||||||
Reference in New Issue
Block a user