Avoid generating uncaught exceptions in app.