Interface CommandExceptionHandler

All Known Implementing Classes:
BukkitExceptionAdapter, BungeeExceptionAdapter, CommandExceptionAdapter, DefaultExceptionHandler, JDAExceptionAdapter, SpongeExceptionAdapter, VelocityExceptionAdapter

public interface CommandExceptionHandler
A handler for all exceptions that may be thrown during the command invocation.

Exceptions may be anything, including Java's normal exceptions, and build-in ones thrown by different components in the framework.

Set with CommandHandler.setExceptionHandler(CommandExceptionHandler).

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    handleException(@NotNull Throwable throwable, @NotNull CommandActor actor)
    Handles the given exception.
  • Method Details

    • handleException

      void handleException(@NotNull @NotNull Throwable throwable, @NotNull @NotNull CommandActor actor)
      Handles the given exception. Note that this method does not provide information about the command context (such as the command, etc.) These are available in individual exceptions and can be accessed only if the thrown exception exposes them.
      Parameters:
      throwable - Exception to handle
      actor - The command actor