Stop input on CancellationException

This commit is contained in:
Him188 2020-08-23 19:52:24 +08:00
parent 33f6a9aff1
commit d2b7421df7

View File

@ -47,7 +47,7 @@ internal fun startupConsoleThread() {
}
}
CoroutineScope(dispatch + SupervisorJob()).launch {
MiraiConsole.launch(dispatch) {
val consoleLogger = DefaultLogger("console")
while (isActive) {
try {
@ -78,6 +78,8 @@ internal fun startupConsoleThread() {
}
} catch (e: InterruptedException) {
return@launch
} catch (e: CancellationException) {
return@launch
} catch (e: Throwable) {
consoleLogger.error("Unhandled exception", e)
}