tts 失败重试bug修复

This commit is contained in:
XL
2025-05-06 14:19:05 +08:00
parent 9fc1285c09
commit 59ef51ea20
8 changed files with 58 additions and 40 deletions
@@ -32,4 +32,6 @@ class TTSProvider(TTSProviderBase):
with open(output_file, "wb") as file:
file.write(resp.content)
else:
logger.bind(tag=TAG).error(f"Custom TTS请求失败: {resp.status_code} - {resp.text}")
error_msg = f"Custom TTS请求失败: {resp.status_code} - {resp.text}"
logger.bind(tag=TAG).error(error_msg)
raise Exception(error_msg) # 抛出异常,让调用方捕获