From d584b765ab5becc19e98241de3063738b55290fa Mon Sep 17 00:00:00 2001
From: Him188 <Him188@mamoe.net>
Date: Thu, 23 Apr 2020 21:47:48 +0800
Subject: [PATCH] Halt bot when failed with `LoginFailedException`

---
 .../net/mamoe/mirai/qqandroid/network/QQAndroidClient.kt       | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/QQAndroidClient.kt b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/QQAndroidClient.kt
index 741ea8f5a..181ebf761 100644
--- a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/QQAndroidClient.kt
+++ b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/QQAndroidClient.kt
@@ -139,6 +139,9 @@ internal open class QQAndroidClient(
                 throw it
             }
         }.getOrElse {
+            if (it is LoginFailedException) {
+                throw it
+            }
             bot.client.serverList.addAll(DefaultServerList)
             throw NoServerAvailableException(it)
         }