As Marco Topolnik said, registering any exception can take a bit of work, but you can also implement your own exception exception handler to do whatever you want with uncaught exceptions.
Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
private final Logger log = Logger.getLogger("EXCEPTION");
public void uncaughtException(final Thread t, final Throwable e) {
log.logp(Level.SEVERE, "EXCEPTION", "", "Unhandled exception in thread " + t.getName() + ": ", e);
}
});
source
share