Uncaught exception handling process in Java