Closed Alceatraz closed 3 years ago
JobCancellationException
属于正常情况
JobCancellationException
属于正常情况 有优雅的办法消音吗,全程完美就最后爆一个没拦截住的exception强迫症犯了(
join的时候catch
由于 deferred.await
等协程库的 API 也会抛出 CancellationException
,及时 mirai 内部都正确处理了,但我仍然担心用户会在 Bot 协程域启动协程并没有捕获 await 的 CE 而直接导致难以调试的情况,就没有过滤 CE。
...我发现这个是 2.6.6,由于网络架构已经完全修改,现在有可能不会再有 CE 发生,请在 2.7-M1 测试
Zulu java 11 Mirai 266
我把bot的两个logger分辨叫做MiraiBot和MiraiNet
启动时注册了:
关闭时会执行以下代码:
在IDE中大概率出现的效果是正常关闭:
但是在生产和某些时候的IDE中出现:
然后我改成
貌似就没再出过问题
推测是执行join时已经关闭了导致报错?