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
ConstructorDescriptionCommandException
(@Nullable Component message) Constructs a newCommandException
with the given message.CommandException
(@Nullable Component message, boolean includeUsage) Constructs a newCommandException
with the given message.CommandException
(@Nullable Component message, Throwable cause) Constructs a newCommandException
with the given message and the given cause.CommandException
(@Nullable Component message, Throwable cause, boolean includeUsage) Constructs a newCommandException
with the given message and the given cause. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Gets 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, getMessage
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
CommandException
Constructs a newCommandException
with the given message.- Parameters:
message
- The detail message
-
CommandException
Constructs a newCommandException
with the given message and the given cause.- Parameters:
message
- The detail messagecause
- The cause
-
CommandException
Constructs a newCommandException
with the given message.- Parameters:
message
- The detail messageincludeUsage
- Whether to include usage in the exception
-
CommandException
Constructs a newCommandException
with 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
-