mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-25 15:40:28 +08:00
Stop input on CancellationException
This commit is contained in:
parent
33f6a9aff1
commit
d2b7421df7
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user