All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.lenni0451.commandlib.utils.interfaces.CommandExceptionHandler Maven / Gradle / Ivy

The newest version!
package net.lenni0451.commandlib.utils.interfaces;

import net.lenni0451.commandlib.contexts.ExecutionContext;
import net.lenni0451.commandlib.exceptions.ArgumentParseException;

/**
 * A functional interface to allow handling exceptions thrown when parsing arguments.
 *
 * @param  The type of the executor
 */
@FunctionalInterface
public interface CommandExceptionHandler {

    /**
     * Handle the thrown exception.
     *
     * @param executor The executor
     * @param t        The thrown exception
     * @throws ArgumentParseException If the exception should be handled as an invalid argument
     * @throws RuntimeException       If the exception should be handled as an internal error
     */
    void handle(final ExecutionContext executor, final Exception t) throws ArgumentParseException, RuntimeException;

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy