Commit 366de98a authored by Him188's avatar Him188

Adjust exception message

parent dc4b0cbe
......@@ -172,7 +172,7 @@ fun <M : Message> MessageChain.firstOrNull(key: Message.Key<M>): M? = when (key)
@JvmSynthetic
@Suppress("UNCHECKED_CAST")
inline fun <M : Message> MessageChain.first(key: Message.Key<M>): 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] 实例
......
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