Class CommandException

All Implemented Interfaces:
Serializable

public class CommandException extends UltiToolsException
Exception thrown when command execution or validation fails.
Since:
6.2.0
Author:
wisdomme
See Also:
  • Constructor Details

    • CommandException

      public CommandException(String message)
      Creates a new command exception with a generic error code.
      Parameters:
      message - the error message
    • CommandException

      public CommandException(ErrorCode errorCode, String message)
      Creates a new command exception with a specific error code.
      Parameters:
      errorCode - the error code
      message - the error message
    • CommandException

      public CommandException(String message, Throwable cause)
      Creates a new command exception with message and cause.
      Parameters:
      message - the error message
      cause - the underlying cause
    • CommandException

      public CommandException(ErrorCode errorCode, String message, Throwable cause)
      Creates a new command exception with error code, message, and cause.
      Parameters:
      errorCode - the error code
      message - the error message
      cause - the underlying cause
  • Method Details

    • permissionDenied

      public static CommandException permissionDenied(String permission)
      Creates an exception for permission denied scenarios.
      Parameters:
      permission - the permission that was denied
      Returns:
      a new CommandException
    • cooldownActive

      public static CommandException cooldownActive(long remainingSeconds)
      Creates an exception for cooldown active scenarios.
      Parameters:
      remainingSeconds - the remaining cooldown time in seconds
      Returns:
      a new CommandException
    • validationFailed

      public static CommandException validationFailed(String validationMessage)
      Creates an exception for validation failures.
      Parameters:
      validationMessage - the validation error message
      Returns:
      a new CommandException
    • parseError

      public static CommandException parseError(String input, Class<?> targetType)
      Creates an exception for parse errors.
      Parameters:
      input - the input that could not be parsed
      targetType - the expected type
      Returns:
      a new CommandException