Prevent the app from crash by most exceptions.