-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Closed
Labels
Milestone
Description
可添加 test 复现:
net.mamoe.mirai.internal.network.impl.common.CommonNHBotNormalLoginTest#test first login failed with CancellationException
@Test
fun `test first login failed with CancellationException`() = runBlockingUnit {
var first = true
setSsoProcessor {
if (first) {
first = false
throw CancellationException("Timed out!")
}
}
bot.login()
assertState(NetworkHandler.State.OK)
}
注意此测试仅供参考, 实际上不能捕获 CancellationException
, 而只能捕获 TimeoutCancellationException
. 因为 CancellationException
可能是用户发起的