You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 =falsethrowCancellationException("Timed out!")
}
}
bot.login()
assertState(NetworkHandler.State.OK)
}
#2504, fix#2488 (#2505)
* #2504,#2488 handle TimeoutCancellationException when resuming connection
* Remove unnecessary code and fix wording
* Use yield() instead of delay
* Use yield() instead of delay
可添加 test 复现:
net.mamoe.mirai.internal.network.impl.common.CommonNHBotNormalLoginTest#test first login failed with CancellationException
注意此测试仅供参考, 实际上不能捕获
CancellationException
, 而只能捕获TimeoutCancellationException
. 因为CancellationException
可能是用户发起的The text was updated successfully, but these errors were encountered: