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
public class CommandException extends ComponentMessageException
Thrown when an executed command raises an error or when execution of the command failed.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CommandException(Component message)Constructs a newCommandExceptionwith the given message.CommandException(Component message, boolean includeUsage)Constructs a newCommandExceptionwith the given message.CommandException(Component message, Throwable cause)Constructs a newCommandExceptionwith the given message and the given cause.CommandException(Component message, Throwable cause, boolean includeUsage)Constructs a newCommandExceptionwith the given message and the given cause.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanshouldIncludeUsage()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 Detail
-
CommandException
public CommandException(Component message)
Constructs a newCommandExceptionwith the given message.- Parameters:
message- The detail message
-
CommandException
public CommandException(Component message, Throwable cause)
Constructs a newCommandExceptionwith the given message and the given cause.- Parameters:
message- The detail messagecause- The cause
-
CommandException
public CommandException(Component message, boolean includeUsage)
Constructs a newCommandExceptionwith the given message.- Parameters:
message- The detail messageincludeUsage- Whether to include usage in the exception
-
CommandException
public CommandException(Component message, Throwable cause, boolean includeUsage)
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
-
-