Package com.gmt2001

Class UncaughtExceptionHandler

java.lang.Object
com.gmt2001.UncaughtExceptionHandler
All Implemented Interfaces:
Thread.UncaughtExceptionHandler

public final class UncaughtExceptionHandler extends Object implements Thread.UncaughtExceptionHandler
Catches exceptions which have not been caught elsewhere
Author:
gmt2001
  • Constructor Details

    • UncaughtExceptionHandler

      public UncaughtExceptionHandler()
  • Method Details

    • instance

      public static UncaughtExceptionHandler instance()
      Instance
      Returns:
      an instance
    • uncaughtException

      public void uncaughtException(Thread t, Throwable e)
      Handles uncaught exceptions

      In addition to sending to the regular error handler (Console, core-error log, Rollbar), the exception is logged in the stacktraces folder

      If the exception is an OutOfMemoryError, then a heap dump is additionally created

      Specified by:
      uncaughtException in interface Thread.UncaughtExceptionHandler
      Parameters:
      t - the thread on which the exception was thrown
      e - the exception that was thrown