Blocking uncaught exceptions in the production mode