Bug fix: Some non-standard forms of error return are not caught (#1877)
This commit is contained in:
parent
18d3245fc9
commit
6cd2d80dfd
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Reference in New Issue