From 366de98a6cfe6b1e344c9e317fd1e3b629afcf9b Mon Sep 17 00:00:00 2001 From: Him188 Date: Tue, 7 Apr 2020 09:01:32 +0800 Subject: [PATCH] Adjust exception message --- .../kotlin/net.mamoe.mirai/message/data/MessageChain.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/MessageChain.kt b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/MessageChain.kt index 7af7b2c84..2f6b310fc 100644 --- a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/MessageChain.kt +++ b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/MessageChain.kt @@ -172,7 +172,7 @@ fun MessageChain.firstOrNull(key: Message.Key): M? = when (key) @JvmSynthetic @Suppress("UNCHECKED_CAST") inline fun MessageChain.first(key: Message.Key): M = - firstOrNull(key) ?: throw NoSuchElementException("Message type $key not found in chain $this") + firstOrNull(key) ?: throw NoSuchElementException("Message type ${key.typeName} not found in chain $this") /** * 获取第一个 [M] 类型的 [Message] 实例