Class MethodCommandExceptionHandler<E extends Throwable,S extends CommandSource>
java.lang.Object
studio.mevera.imperat.annotations.base.parsers.MethodCommandExceptionHandler<E,S>
- All Implemented Interfaces:
CommandExceptionHandler<E,S>
public final class MethodCommandExceptionHandler<E extends Throwable,S extends CommandSource>
extends Object
implements CommandExceptionHandler<E,S>
-
Method Summary
Modifier and TypeMethodDescriptionvoidresolve(E exception, CommandContext<S> context) Resolves the given exception within the provided execution context.
-
Method Details
-
getExceptionType
-
resolve
Description copied from interface:CommandExceptionHandlerResolves the given exception within the provided execution context. This method is called when an exception of typeEoccurs during command execution, allowing for custom handling such as user notification, logging, cleanup operations, or alternative command flows.Implementations should be mindful of:
- Not throwing additional exceptions unless absolutely necessary
- Providing meaningful feedback to the command source when appropriate
- Performing any necessary cleanup or state restoration
- Logging errors for debugging purposes when needed
The resolution process should be non-blocking and efficient, as it's part of the critical command execution path.
- Specified by:
resolvein interfaceCommandExceptionHandler<E extends Throwable,S extends CommandSource> - Parameters:
exception- the exception that occurred during command execution, nevernullcontext- the execution context containing the source, command state, and other relevant information at the time the exception occurred, nevernull- See Also:
-