Catch exceptions in app.