mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-15 05:00:10 +08:00
[console] Fix exception not caught when closing bot while auto login; fix #2740
This commit is contained in:
parent
61e8501c66
commit
7859767b56
@ -435,7 +435,13 @@ ___ ____ _ _____ _
|
|||||||
}
|
}
|
||||||
}.onFailure {
|
}.onFailure {
|
||||||
mainLogger.error(it)
|
mainLogger.error(it)
|
||||||
|
|
||||||
|
runCatching {
|
||||||
bot.close()
|
bot.close()
|
||||||
|
}.onFailure { err ->
|
||||||
|
mainLogger.error("Error in closing bot", err)
|
||||||
|
}
|
||||||
|
|
||||||
launch {
|
launch {
|
||||||
AutoLoginEvent.Failure(bot = bot, cause = it).broadcast()
|
AutoLoginEvent.Failure(bot = bot, cause = it).broadcast()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user