diff --git a/mirai-core/src/commonMain/kotlin/AbstractBot.kt b/mirai-core/src/commonMain/kotlin/AbstractBot.kt index ad7194ed5..1b6c3d77d 100644 --- a/mirai-core/src/commonMain/kotlin/AbstractBot.kt +++ b/mirai-core/src/commonMain/kotlin/AbstractBot.kt @@ -142,7 +142,9 @@ internal abstract class AbstractBot constructor( // normally closed return@subscribeAlways } - bot.logger.info { "Connection lost, retrying login" } + + val causeMessage = event.castOrNull()?.cause?.toString() ?: event.toString() + bot.logger.info { "Connection lost, retrying login ($causeMessage)" } bot.asQQAndroidBot().client.run { if (serverList.isEmpty()) { @@ -171,9 +173,9 @@ internal abstract class AbstractBot constructor( } - // Close network to avoid endless reconnection while network is ok - // https://github.com/mamoe/mirai/issues/894 - kotlin.runCatching { network.close(event.castOrNull()?.cause) } + // Close network to avoid endless reconnection while network is ok + // https://github.com/mamoe/mirai/issues/894 + kotlin.runCatching { network.close(event.castOrNull()?.cause) } login() _network.postInitActions()