mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-28 05:37:26 +08:00
🥅 fix ValueError to Exception
This commit is contained in:
parent
6f2b9a1d13
commit
da290dad07
@ -12,7 +12,7 @@ _running_matcher: Dict[str, int] = {}
|
|||||||
async def _(matcher: Matcher, bot: Bot, event: Event, state: T_State):
|
async def _(matcher: Matcher, bot: Bot, event: Event, state: T_State):
|
||||||
try:
|
try:
|
||||||
session_id = event.get_session_id()
|
session_id = event.get_session_id()
|
||||||
except ValueError:
|
except Exception:
|
||||||
return
|
return
|
||||||
current_event_id = id(event)
|
current_event_id = id(event)
|
||||||
event_id = _running_matcher.get(session_id, None)
|
event_id = _running_matcher.get(session_id, None)
|
||||||
@ -26,7 +26,7 @@ async def _(matcher: Matcher, bot: Bot, event: Event, state: T_State):
|
|||||||
async def _(matcher: Matcher, exception: Optional[Exception], bot: Bot, event: Event, state: T_State):
|
async def _(matcher: Matcher, exception: Optional[Exception], bot: Bot, event: Event, state: T_State):
|
||||||
try:
|
try:
|
||||||
session_id = event.get_session_id()
|
session_id = event.get_session_id()
|
||||||
except ValueError:
|
except Exception:
|
||||||
return
|
return
|
||||||
if session_id in _running_matcher:
|
if session_id in _running_matcher:
|
||||||
del _running_matcher[session_id]
|
del _running_matcher[session_id]
|
||||||
|
Loading…
Reference in New Issue
Block a user