mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-13 20:10:09 +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 {
|
||||
mainLogger.error(it)
|
||||
bot.close()
|
||||
|
||||
runCatching {
|
||||
bot.close()
|
||||
}.onFailure { err ->
|
||||
mainLogger.error("Error in closing bot", err)
|
||||
}
|
||||
|
||||
launch {
|
||||
AutoLoginEvent.Failure(bot = bot, cause = it).broadcast()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user