Class FallbackExceptionHandler
java.lang.Object
ca.corbett.extras.FallbackExceptionHandler
- All Implemented Interfaces:
Thread.UncaughtExceptionHandler
Fallback handler for any exception that goes uncaught in any thread.
This class ensures that the exception gets logged with the full stack trace.
By default, uncaught exceptions print a stack trace to the console, but that
is not helpful if the application wasn't started via a terminal.
Use the static register() method to set this as the default uncaught exception handler for all threads in your application startup code.
Note that this handler will only be used if the current Thread and/or ThreadGroup does not have its own uncaught exception handler. This class represents a last-ditch fallback.
- Since:
- swing-extras 2.9
- Author:
- scorbo2
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidregister()Registers an instance of this handler as the default uncaught exception handler for all threads in the application.voiduncaughtException(Thread t, Throwable e)
-
Constructor Details
-
FallbackExceptionHandler
public FallbackExceptionHandler()
-
-
Method Details
-
uncaughtException
- Specified by:
uncaughtExceptionin interfaceThread.UncaughtExceptionHandler
-
register
public static void register()Registers an instance of this handler as the default uncaught exception handler for all threads in the application.
-