Temporarily catch uncaught exceptions