Exception handling for uncaught exceptions