[console] Fix exception not caught when closing bot while auto login; fix #2740

This commit is contained in:
Karlatemp 2023-07-25 19:28:17 +08:00
parent 61e8501c66
commit 7859767b56
No known key found for this signature in database
GPG Key ID: BA173CA2B9956C59

View File

@ -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()
}