@FunctionalInterface
public interface CommandExceptionHandler<A extends CommandActor>
Exceptions may be anything, including Java's normal exceptions, and build-in ones thrown by different components in the framework.
Set with Lamp.Builder#exceptionHandler(CommandExceptionHandler).
For a flexible yet powerful implementation, see RuntimeExceptionAdapter
which allows handling exceptions in smaller functions
RuntimeExceptionAdapter| Modifier and Type | Method and Description |
|---|---|
void |
handleException(@NotNull java.lang.Throwable throwable,
@NotNull ErrorContext<A> errorContext)
Handles the given exception.
|
void handleException(@NotNull
@NotNull java.lang.Throwable throwable,
@NotNull
@NotNull ErrorContext<A> errorContext)
throwable - Exception to handleerrorContext - The context in which the error occurred. For example,
if the error was because a parameter was invalid, this
will be a ErrorContext.ParsingParameter context,
which contains information about the parameter being parsed.