Interface ExceptionHandler

  • All Superinterfaces:
    java.util.function.Consumer<java.lang.Throwable>

    public interface ExceptionHandler
    extends java.util.function.Consumer<java.lang.Throwable>
    Interface for implementation to handle exceptions which occur. This is similar to Thread.UncaughtExceptionHandler, except that exceptions provided to this interface are handled on the same thread that threw the exception, and the thread that threw it likely WONT die.
    Since:
    4.3.0 (since 2.4.0 as ExceptionHandlerInterface)
    • Method Detail

      • handleException

        void handleException​(java.lang.Throwable thrown)
        An exception was thrown on this thread, and is now being provided to this handler to handle it (possibly just to simply log it occurred).
        Parameters:
        thrown - Throwable that was thrown, and caught
      • accept

        default void accept​(java.lang.Throwable thrown)
        Specified by:
        accept in interface java.util.function.Consumer<java.lang.Throwable>