mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-01-19 09:38:21 +08:00
🔊 fix error uncatched in bot.handle_message
This commit is contained in:
parent
c2badaec42
commit
adc69a2763
@ -214,14 +214,19 @@ class Bot(BaseBot):
|
|||||||
ResultStore.add_result(message)
|
ResultStore.add_result(message)
|
||||||
return
|
return
|
||||||
|
|
||||||
event = Event(message)
|
try:
|
||||||
|
event = Event(message)
|
||||||
|
|
||||||
# Check whether user is calling me
|
# Check whether user is calling me
|
||||||
await _check_reply(self, event)
|
await _check_reply(self, event)
|
||||||
_check_at_me(self, event)
|
_check_at_me(self, event)
|
||||||
_check_nickname(self, event)
|
_check_nickname(self, event)
|
||||||
|
|
||||||
await handle_event(self, event)
|
await handle_event(self, event)
|
||||||
|
except Exception as e:
|
||||||
|
logger.opt(colors=True, exception=e).error(
|
||||||
|
f"<r><bg #f8bbd0>Failed to handle event. Raw: {message}</bg #f8bbd0></r>"
|
||||||
|
)
|
||||||
|
|
||||||
@overrides(BaseBot)
|
@overrides(BaseBot)
|
||||||
async def call_api(self, api: str, **data) -> Union[Any, NoReturn]:
|
async def call_api(self, api: str, **data) -> Union[Any, NoReturn]:
|
||||||
|
Loading…
Reference in New Issue
Block a user