From 3933c3e8fbd376bfe031138500e0f259cf3b5a60 Mon Sep 17 00:00:00 2001 From: Him188 Date: Mon, 26 Oct 2020 08:13:59 +0800 Subject: [PATCH] CommandDeclarationException --- .../mirai/console/command/descriptor/Exceptions.kt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/command/descriptor/Exceptions.kt b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/command/descriptor/Exceptions.kt index b92ab8b68..4ce6f7338 100644 --- a/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/command/descriptor/Exceptions.kt +++ b/backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/command/descriptor/Exceptions.kt @@ -29,13 +29,20 @@ public open class NoValueArgumentMappingException( public val forType: KType, ) : CommandResolutionException("Cannot find a CommandArgument mapping for ${forType.qualifiedName}") +public open class CommandResolutionException : RuntimeException { + public constructor() : super() + public constructor(message: String?) : super(message) + public constructor(message: String?, cause: Throwable?) : super(message, cause) + public constructor(cause: Throwable?) : super(cause) +} + @ExperimentalCommandDescriptors public open class CommandDeclarationClashException( public val command: Command, public val signatures: List, -) : CommandResolutionException("Command declaration clash: \n${signatures.joinToString("\n")}") +) : CommandDeclarationException("Declaration clash for command '${command.primaryName}': \n${signatures.joinToString("\n")}") -public open class CommandResolutionException : RuntimeException { +public open class CommandDeclarationException : RuntimeException { public constructor() : super() public constructor(message: String?) : super(message) public constructor(message: String?, cause: Throwable?) : super(message, cause)