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:
java.io.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 newCommandException
with the given message.CommandException(Component message, boolean includeUsage)
Constructs a newCommandException
with the given message.CommandException(Component message, java.lang.Throwable cause)
Constructs a newCommandException
with the given message and the given cause.CommandException(Component message, java.lang.Throwable cause, boolean includeUsage)
Constructs a newCommandException
with the given message and the given cause.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
shouldIncludeUsage()
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
-
-
-
-
Constructor Detail
-
CommandException
public CommandException(Component message)
Constructs a newCommandException
with the given message.- Parameters:
message
- The detail message
-
CommandException
public CommandException(Component message, java.lang.Throwable cause)
Constructs a newCommandException
with the given message and the given cause.- Parameters:
message
- The detail messagecause
- The cause
-
CommandException
public CommandException(Component message, boolean includeUsage)
Constructs a newCommandException
with the given message.- Parameters:
message
- The detail messageincludeUsage
- Whether to include usage in the exception
-
CommandException
public CommandException(Component message, java.lang.Throwable cause, boolean includeUsage)
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
-
-