Wrap uncaught exceptions