Commit b9be152f authored by Him188's avatar Him188

Add explicit `throws` declaration

parent 1ac29027
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
package net.mamoe.mirai package net.mamoe.mirai
import net.mamoe.mirai.utils.BotConfiguration import net.mamoe.mirai.utils.BotConfiguration
import net.mamoe.mirai.utils.LoginFailedException
import kotlin.contracts.ExperimentalContracts import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.InvocationKind import kotlin.contracts.InvocationKind
import kotlin.contracts.contract import kotlin.contracts.contract
...@@ -18,12 +19,16 @@ import kotlin.jvm.JvmName ...@@ -18,12 +19,16 @@ import kotlin.jvm.JvmName
//Contacts //Contacts
/** /**
* 使用默认的配置 ([BotConfiguration.Default]) 登录, 返回 [this] * 使用默认的配置 ([BotConfiguration.Default]) 登录, 返回 [this]
*
* @throws LoginFailedException
*/ */
suspend inline fun Bot.alsoLogin(configuration: BotConfiguration = BotConfiguration.Default): Bot = suspend inline fun Bot.alsoLogin(configuration: BotConfiguration = BotConfiguration.Default): Bot =
apply { login(configuration) } apply { login(configuration) }
/** /**
* 使用在默认配置基础上修改的配置进行登录, 返回 [this] * 使用在默认配置基础上修改的配置进行登录, 返回 [this]
*
* @throws LoginFailedException
*/ */
@UseExperimental(ExperimentalContracts::class) @UseExperimental(ExperimentalContracts::class)
suspend inline fun Bot.alsoLogin(configuration: BotConfiguration.() -> Unit): Bot { suspend inline fun Bot.alsoLogin(configuration: BotConfiguration.() -> Unit): Bot {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment