Class 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:
  • Constructor Details

    • CommandException

      public CommandException(Component message)
      Constructs a new CommandException with the given message.
      Parameters:
      message - The detail message
    • CommandException

      public CommandException(Component message, Throwable cause)
      Constructs a new CommandException with the given message and the given cause.
      Parameters:
      message - The detail message
      cause - The cause
    • CommandException

      public CommandException(Component message, boolean includeUsage)
      Constructs a new CommandException with the given message.
      Parameters:
      message - The detail message
      includeUsage - Whether to include usage in the exception
    • CommandException

      public CommandException(Component message, Throwable cause, boolean includeUsage)
      Constructs a new CommandException with the given message and the given cause.
      Parameters:
      message - The detail message
      cause - The cause
      includeUsage - 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