Ignore CancellationException on stop

This commit is contained in:
Him188 2020-09-10 09:08:19 +08:00
parent 405d8cd88f
commit a70e00464f

View File

@ -113,7 +113,7 @@ public object BuiltInCommands {
closingLock.withLock {
sendMessage("Stopping mirai-console")
kotlin.runCatching {
MiraiConsole.job.cancelAndJoin()
ignoreException<CancellationException> { MiraiConsole.job.cancelAndJoin() }
}.fold(
onSuccess = {
ignoreException<EventCancelledException> { sendMessage("mirai-console stopped successfully.") }