I asked a question about how to override the default Java Exception handling here and was told the answer here.
The question is now : is there a way to generify this
You can use Thread.setDefaultUncaughtExceptionHandler(Thread.UncaughtExceptionHandler eh) for that case if i got it right.
Thread.setDefaultUncaughtExceptionHandler(Thread.UncaughtExceptionHandler eh)
See Thread.setDefaultUncaughtExceptionHandler