mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-27 17:00:14 +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")
|
val consoleLogger = DefaultLogger("console")
|
||||||
while (isActive) {
|
while (isActive) {
|
||||||
try {
|
try {
|
||||||
@ -78,6 +78,8 @@ internal fun startupConsoleThread() {
|
|||||||
}
|
}
|
||||||
} catch (e: InterruptedException) {
|
} catch (e: InterruptedException) {
|
||||||
return@launch
|
return@launch
|
||||||
|
} catch (e: CancellationException) {
|
||||||
|
return@launch
|
||||||
} catch (e: Throwable) {
|
} catch (e: Throwable) {
|
||||||
consoleLogger.error("Unhandled exception", e)
|
consoleLogger.error("Unhandled exception", e)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user