feat: 应用层异常处理

This commit is contained in:
RockChinQ
2024-01-30 14:58:34 +08:00
parent 3945ac95d1
commit 437971ded8
3 changed files with 20 additions and 5 deletions

View File

@@ -4,6 +4,7 @@ import json
import os
import logging
import asyncio
import traceback
from mirai import At, GroupMessage, MessageEvent, StrangerMessage, \
FriendMessage, Image, MessageChain, Plain
@@ -150,4 +151,8 @@ class QQBotManager:
)
async def run(self):
await self.adapter.run_async()
try:
await self.adapter.run_async()
except Exception as e:
self.ap.logger.error('平台适配器运行出错: ' + str(e))
self.ap.logger.debug(f"Traceback: {traceback.format_exc()}")