请求错误时继续翻译

This commit is contained in:
xunbu
2025-06-30 10:29:56 +08:00
parent 7f885542fa
commit 1e04b24b78
2 changed files with 4 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
__version__="0.2.38"
__version__="0.2.39b1"

View File

@@ -107,7 +107,9 @@ class Agent:
result = response.json()["choices"][0]["message"]["content"]
return result
except httpx.HTTPStatusError as e:
raise Exception(f"AI请求错误 (async): {e.response.status_code} - {e.response.text}")
translater_logger.warning(f"AI请求错误 (async): {e.response.status_code} - {e.response.text}")
print(f"system_prompt:\n{system_prompt}\nprompt:\n{prompt}")
return prompt
except httpx.RequestError as e:
translater_logger.warning(f"AI请求连接错误 (async): {repr(e)}")
except (KeyError, IndexError) as e: