Class CommandException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.spongepowered.api.util.ComponentMessageException
org.spongepowered.api.command.exception.CommandException
- All Implemented Interfaces:
Serializable,ComponentMessageThrowable
- Direct Known Subclasses:
ArgumentParseException,CommandNotFoundException,CommandPermissionException,InvocationCommandException
Thrown when an executed command raises an error or when execution of
the command failed.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCommandException(@Nullable Component message) Constructs a newCommandExceptionwith the given message.CommandException(@Nullable Component message, boolean includeUsage) Constructs a newCommandExceptionwith the given message.CommandException(@Nullable Component message, Throwable cause) Constructs a newCommandExceptionwith the given message and the given cause.CommandException(@Nullable Component message, Throwable cause, boolean includeUsage) Constructs a newCommandExceptionwith the given message and the given cause. -
Method Summary
Modifier and TypeMethodDescriptionbooleanGets whether the exception should include usage in the presentation of the exception/stack-trace.Methods inherited from class org.spongepowered.api.util.ComponentMessageException
componentMessage, getLocalizedMessage, getMessageMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
CommandException
Constructs a newCommandExceptionwith the given message.- Parameters:
message- The detail message
-
CommandException
Constructs a newCommandExceptionwith the given message and the given cause.- Parameters:
message- The detail messagecause- The cause
-
CommandException
Constructs a newCommandExceptionwith the given message.- Parameters:
message- The detail messageincludeUsage- Whether to include usage in the exception
-
CommandException
Constructs a newCommandExceptionwith the given message and the given cause.- Parameters:
message- The detail messagecause- The causeincludeUsage- Whether to include the usage in the exception
-
-
Method Details
-
shouldIncludeUsage
public boolean shouldIncludeUsage()Gets whether the exception should include usage in the presentation of the exception/stack-trace.- Returns:
- Whether to include usage in the exception
-