Class ExceptionHelper.Handler<T extends Throwable>

    • Constructor Detail

      • Handler

        public Handler​(Class<T> type,
                       Consumer<T> consumer)
        Creates an exception handler.
        Parameters:
        type - the exception class
        consumer - the consumer to handle the exception
    • Method Detail

      • appliesTo

        public boolean appliesTo​(Throwable t)
        Checks if handler applies to the given exception.
        Parameters:
        t - the exception
        Returns:
        true if handler applies
      • handle

        public void handle​(T t)
        Handles the exception.
        Parameters:
        t - the exception