diff --git a/mirai-console/backend/mirai-console/src/internal/MiraiConsoleImplementationBridge.kt b/mirai-console/backend/mirai-console/src/internal/MiraiConsoleImplementationBridge.kt index a016aa03ae..662b657cf8 100644 --- a/mirai-console/backend/mirai-console/src/internal/MiraiConsoleImplementationBridge.kt +++ b/mirai-console/backend/mirai-console/src/internal/MiraiConsoleImplementationBridge.kt @@ -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() }