mirror of
https://github.com/A-Minos/nonebot-plugin-tetris-stats.git
synced 2026-03-05 05:36:54 +08:00
🎨 修改错误处理逻辑
This commit is contained in:
@@ -91,9 +91,10 @@ async def _(bot: Bot, event: Event, matcher: Matcher, account: User):
|
|||||||
command_args=[],
|
command_args=[],
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
await matcher.finish(await proc.handle_bind(platform=get_platform(bot), account=event.get_user_id()))
|
await matcher.send(await proc.handle_bind(platform=get_platform(bot), account=event.get_user_id()))
|
||||||
except NeedCatchError as e:
|
except NeedCatchError as e:
|
||||||
await matcher.finish(str(e))
|
await matcher.send(str(e))
|
||||||
|
raise
|
||||||
|
|
||||||
|
|
||||||
@alc.assign('query')
|
@alc.assign('query')
|
||||||
@@ -114,9 +115,10 @@ async def _(bot: Bot, event: Event, matcher: Matcher, target: At | Me):
|
|||||||
command_args=[],
|
command_args=[],
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
await matcher.finish(message + await proc.handle_query())
|
await matcher.send(message + await proc.handle_query())
|
||||||
except NeedCatchError as e:
|
except NeedCatchError as e:
|
||||||
await matcher.finish(str(e))
|
await matcher.send(str(e))
|
||||||
|
raise
|
||||||
|
|
||||||
|
|
||||||
@alc.assign('query')
|
@alc.assign('query')
|
||||||
@@ -127,9 +129,10 @@ async def _(event: Event, matcher: Matcher, account: User):
|
|||||||
command_args=[],
|
command_args=[],
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
await matcher.finish(await proc.handle_query())
|
await matcher.send(await proc.handle_query())
|
||||||
except NeedCatchError as e:
|
except NeedCatchError as e:
|
||||||
await matcher.finish(str(e))
|
await matcher.send(str(e))
|
||||||
|
raise
|
||||||
|
|
||||||
|
|
||||||
@alc.assign('rank')
|
@alc.assign('rank')
|
||||||
|
|||||||
@@ -74,9 +74,10 @@ async def _(bot: Bot, event: Event, matcher: Matcher, account: User):
|
|||||||
command_args=[],
|
command_args=[],
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
await matcher.finish(await proc.handle_bind(platform=get_platform(bot), account=event.get_user_id()))
|
await matcher.send(await proc.handle_bind(platform=get_platform(bot), account=event.get_user_id()))
|
||||||
except NeedCatchError as e:
|
except NeedCatchError as e:
|
||||||
await matcher.finish(str(e))
|
await matcher.send(str(e))
|
||||||
|
raise
|
||||||
|
|
||||||
|
|
||||||
@alc.assign('query')
|
@alc.assign('query')
|
||||||
@@ -97,9 +98,10 @@ async def _(bot: Bot, event: Event, matcher: Matcher, target: At | Me):
|
|||||||
command_args=[],
|
command_args=[],
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
await matcher.finish(message + await proc.handle_query())
|
await matcher.send(message + await proc.handle_query())
|
||||||
except NeedCatchError as e:
|
except NeedCatchError as e:
|
||||||
await matcher.finish(str(e))
|
await matcher.send(str(e))
|
||||||
|
raise
|
||||||
|
|
||||||
|
|
||||||
@alc.assign('query')
|
@alc.assign('query')
|
||||||
@@ -110,9 +112,10 @@ async def _(event: Event, matcher: Matcher, account: User):
|
|||||||
command_args=[],
|
command_args=[],
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
await matcher.finish(await proc.handle_query())
|
await matcher.send(await proc.handle_query())
|
||||||
except NeedCatchError as e:
|
except NeedCatchError as e:
|
||||||
await matcher.finish(str(e))
|
await matcher.send(str(e))
|
||||||
|
raise
|
||||||
|
|
||||||
|
|
||||||
add_default_handlers(alc)
|
add_default_handlers(alc)
|
||||||
|
|||||||
@@ -84,9 +84,10 @@ try:
|
|||||||
command_args=[],
|
command_args=[],
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
await matcher.finish(await proc.handle_query())
|
await matcher.send(await proc.handle_query())
|
||||||
except NeedCatchError as e:
|
except NeedCatchError as e:
|
||||||
await matcher.finish(str(e))
|
await matcher.send(str(e))
|
||||||
|
raise
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@@ -99,9 +100,10 @@ async def _(bot: Bot, event: Event, matcher: Matcher, account: User):
|
|||||||
command_args=[],
|
command_args=[],
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
await matcher.finish(await proc.handle_bind(platform=get_platform(bot), account=event.get_user_id()))
|
await matcher.send(await proc.handle_bind(platform=get_platform(bot), account=event.get_user_id()))
|
||||||
except NeedCatchError as e:
|
except NeedCatchError as e:
|
||||||
await matcher.finish(str(e))
|
await matcher.send(str(e))
|
||||||
|
raise
|
||||||
|
|
||||||
|
|
||||||
@alc.assign('query')
|
@alc.assign('query')
|
||||||
@@ -122,9 +124,10 @@ async def _(bot: Bot, event: Event, matcher: Matcher, target: At | Me):
|
|||||||
command_args=[],
|
command_args=[],
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
await matcher.finish(message + await proc.handle_query())
|
await matcher.send(message + await proc.handle_query())
|
||||||
except NeedCatchError as e:
|
except NeedCatchError as e:
|
||||||
await matcher.finish(str(e))
|
await matcher.send(str(e))
|
||||||
|
raise
|
||||||
|
|
||||||
|
|
||||||
@alc.assign('query')
|
@alc.assign('query')
|
||||||
@@ -135,9 +138,10 @@ async def _(event: Event, matcher: Matcher, account: User):
|
|||||||
command_args=[],
|
command_args=[],
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
await matcher.finish(await proc.handle_query())
|
await matcher.send(await proc.handle_query())
|
||||||
except NeedCatchError as e:
|
except NeedCatchError as e:
|
||||||
await matcher.finish(str(e))
|
await matcher.send(str(e))
|
||||||
|
raise
|
||||||
|
|
||||||
|
|
||||||
add_default_handlers(alc)
|
add_default_handlers(alc)
|
||||||
|
|||||||
Reference in New Issue
Block a user