Class CommandException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.ultikits.ultitools.exceptions.UltiToolsException
com.ultikits.ultitools.exceptions.CommandException
- All Implemented Interfaces:
Serializable
Exception thrown when command execution or validation fails.
- Since:
- 6.2.0
- Author:
- wisdomme
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCommandException(ErrorCode errorCode, String message) Creates a new command exception with a specific error code.CommandException(ErrorCode errorCode, String message, Throwable cause) Creates a new command exception with error code, message, and cause.CommandException(String message) Creates a new command exception with a generic error code.CommandException(String message, Throwable cause) Creates a new command exception with message and cause. -
Method Summary
Modifier and TypeMethodDescriptionstatic CommandExceptioncooldownActive(long remainingSeconds) Creates an exception for cooldown active scenarios.static CommandExceptionparseError(String input, Class<?> targetType) Creates an exception for parse errors.static CommandExceptionpermissionDenied(String permission) Creates an exception for permission denied scenarios.static CommandExceptionvalidationFailed(String validationMessage) Creates an exception for validation failures.Methods inherited from class UltiToolsException
getErrorCode, getFormattedMessage, toStringMethods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
Constructor Details
-
CommandException
Creates a new command exception with a generic error code.- Parameters:
message- the error message
-
CommandException
-
CommandException
-
CommandException
-
-
Method Details
-
permissionDenied
Creates an exception for permission denied scenarios.- Parameters:
permission- the permission that was denied- Returns:
- a new CommandException
-
cooldownActive
Creates an exception for cooldown active scenarios.- Parameters:
remainingSeconds- the remaining cooldown time in seconds- Returns:
- a new CommandException
-
validationFailed
Creates an exception for validation failures.- Parameters:
validationMessage- the validation error message- Returns:
- a new CommandException
-
parseError
Creates an exception for parse errors.- Parameters:
input- the input that could not be parsedtargetType- the expected type- Returns:
- a new CommandException
-