From 0e88990b133a8e229344cea46ed62fd3adccc149 Mon Sep 17 00:00:00 2001 From: Him188 Date: Mon, 16 Nov 2020 15:42:23 +0800 Subject: [PATCH] Improve error messages --- .../src/command/descriptor/CommandArgumentParserBuiltins.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/mirai-console/src/command/descriptor/CommandArgumentParserBuiltins.kt b/backend/mirai-console/src/command/descriptor/CommandArgumentParserBuiltins.kt index 4e0946376..e9f61a070 100644 --- a/backend/mirai-console/src/command/descriptor/CommandArgumentParserBuiltins.kt +++ b/backend/mirai-console/src/command/descriptor/CommandArgumentParserBuiltins.kt @@ -339,7 +339,7 @@ public object ExistingMemberValueArgumentParser : InternalCommandValueArgumentPa public object PermissionIdValueArgumentParser : InternalCommandValueArgumentParserExtensions() { override fun parse(raw: String, sender: CommandSender): PermissionId { return kotlin.runCatching { PermissionId.parseFromString(raw) }.getOrElse { - illegalArgument("无法解析 $raw 为 PermissionId") + illegalArgument("无法解析 $raw 为权限 ID.") } } } @@ -348,7 +348,7 @@ public object PermitteeIdValueArgumentParser : InternalCommandValueArgumentParse override fun parse(raw: String, sender: CommandSender): PermitteeId { return if (raw == "~") sender.permitteeId else kotlin.runCatching { AbstractPermitteeId.parseFromString(raw) }.getOrElse { - illegalArgument("无法解析 $raw 为 PermissibleIdentifier") + illegalArgument("无法解析 $raw 为被许可人 ID.") } }