Skip to content

Commit 1f58cf4

Browse files
committed
fix(tts): 优化 tts 异常捕获
- 移除了 FileNotFoundError、ValueError 和 NotADirectoryError 的异常捕获 - 仅保留 APIException 的捕获,以处理 API 相关的错误
1 parent 9c0c34f commit 1f58cf4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

nonebot_plugin_fishspeech_tts/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ async def tts_handle(message: UniMsg, match: tuple = RegexGroup()):
8989
)
9090
audio = await fish_speech_api.generate_tts(request)
9191
await UniMessage.voice(raw=audio).finish()
92-
except (APIException, FileNotFoundError, ValueError, NotADirectoryError) as e:
92+
except APIException as e:
9393
await tts_handler.finish(str(e))
9494

9595

0 commit comments

Comments
 (0)