Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
Mirai
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Mirai
Commits
0a7ebffd
Commit
0a7ebffd
authored
Jul 16, 2020
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #428
parent
58908d60
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
4 deletions
+18
-4
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/QQAndroidBotNetworkHandler.kt
...moe/mirai/qqandroid/network/QQAndroidBotNetworkHandler.kt
+6
-1
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/LoginFailedException.kt
...in/kotlin/net.mamoe.mirai/network/LoginFailedException.kt
+12
-3
No files found.
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/QQAndroidBotNetworkHandler.kt
View file @
0a7ebffd
...
@@ -24,6 +24,7 @@ import net.mamoe.mirai.event.events.BotOfflineEvent
...
@@ -24,6 +24,7 @@ import net.mamoe.mirai.event.events.BotOfflineEvent
import
net.mamoe.mirai.event.events.BotOnlineEvent
import
net.mamoe.mirai.event.events.BotOnlineEvent
import
net.mamoe.mirai.event.events.BotReloginEvent
import
net.mamoe.mirai.event.events.BotReloginEvent
import
net.mamoe.mirai.message.MessageEvent
import
net.mamoe.mirai.message.MessageEvent
import
net.mamoe.mirai.network.RetryLaterException
import
net.mamoe.mirai.network.UnsupportedSMSLoginException
import
net.mamoe.mirai.network.UnsupportedSMSLoginException
import
net.mamoe.mirai.network.WrongPasswordException
import
net.mamoe.mirai.network.WrongPasswordException
import
net.mamoe.mirai.qqandroid.QQAndroidBot
import
net.mamoe.mirai.qqandroid.QQAndroidBot
...
@@ -176,8 +177,12 @@ internal class QQAndroidBotNetworkHandler(coroutineContext: CoroutineContext, bo
...
@@ -176,8 +177,12 @@ internal class QQAndroidBotNetworkHandler(coroutineContext: CoroutineContext, bo
}
}
}
}
is
WtLogin
.
Login
.
LoginPacketResponse
.
Error
->
is
WtLogin
.
Login
.
LoginPacketResponse
.
Error
->
{
if
(
response
.
message
.
contains
(
"0x9a"
))
{
//Error(title=登录失败, message=请你稍后重试。(0x9a), errorInfo=)
throw
RetryLaterException
()
}
throw
WrongPasswordException
(
response
.
toString
())
throw
WrongPasswordException
(
response
.
toString
())
}
is
WtLogin
.
Login
.
LoginPacketResponse
.
DeviceLockLogin
->
{
is
WtLogin
.
Login
.
LoginPacketResponse
.
DeviceLockLogin
->
{
response
=
WtLogin
.
Login
.
SubCommand20
(
response
=
WtLogin
.
Login
.
SubCommand20
(
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/LoginFailedException.kt
View file @
0a7ebffd
...
@@ -13,6 +13,8 @@ package net.mamoe.mirai.network
...
@@ -13,6 +13,8 @@ package net.mamoe.mirai.network
import
net.mamoe.mirai.Bot
import
net.mamoe.mirai.Bot
import
net.mamoe.mirai.utils.MiraiExperimentalAPI
import
net.mamoe.mirai.utils.MiraiExperimentalAPI
import
net.mamoe.mirai.utils.MiraiInternalAPI
import
net.mamoe.mirai.utils.SinceMirai
/**
/**
* 在 [登录][Bot.login] 失败时抛出, 可正常地中断登录过程.
* 在 [登录][Bot.login] 失败时抛出, 可正常地中断登录过程.
...
@@ -29,17 +31,24 @@ sealed class LoginFailedException constructor(
...
@@ -29,17 +31,24 @@ sealed class LoginFailedException constructor(
/**
/**
* 密码输入错误 (有时候也会是其他错误, 如 `"当前上网环境异常,请更换网络环境或在常用设备上登录或稍后再试。"`)
* 密码输入错误 (有时候也会是其他错误, 如 `"当前上网环境异常,请更换网络环境或在常用设备上登录或稍后再试。"`)
*/
*/
class
WrongPasswordException
(
message
:
String
?)
:
LoginFailedException
(
true
,
message
)
class
WrongPasswordException
@MiraiInternalAPI
constructor
(
message
:
String
?)
:
LoginFailedException
(
true
,
message
)
/**
/**
* 无可用服务器
* 无可用服务器
*/
*/
class
NoServerAvailableException
(
override
val
cause
:
Throwable
?)
:
LoginFailedException
(
false
,
"no server available"
)
class
NoServerAvailableException
@MiraiInternalAPI
constructor
(
override
val
cause
:
Throwable
?)
:
LoginFailedException
(
false
,
"no server available"
)
/**
* 服务器要求稍后重试
*/
@SinceMirai
(
"1.2.0"
)
class
RetryLaterException
@MiraiInternalAPI
constructor
()
:
LoginFailedException
(
false
,
"server requests retrial later"
)
/**
/**
* 无标准输入或 Kotlin 不支持此输入.
* 无标准输入或 Kotlin 不支持此输入.
*/
*/
class
NoStandardInputForCaptchaException
(
override
val
cause
:
Throwable
?)
:
class
NoStandardInputForCaptchaException
@MiraiInternalAPI
constructor
(
override
val
cause
:
Throwable
?)
:
LoginFailedException
(
true
,
"no standard input for captcha"
)
LoginFailedException
(
true
,
"no standard input for captcha"
)
/**
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment