fix:尝试修复模型请求失败炸循环

This commit is contained in:
SengokuCola
2025-04-04 21:15:14 +08:00
parent e2205eb78b
commit 72d1ff7cd9

View File

@@ -29,7 +29,10 @@ class BaseMessageHandler:
try:
tasks.append(handler(message))
except Exception as e:
raise RuntimeError(str(e)) from e
logger.error(f"消息处理出错: {str(e)}")
logger.error(traceback.format_exc())
# 不抛出异常,而是记录错误并继续处理其他消息
continue
if tasks:
await asyncio.gather(*tasks, return_exceptions=True)