Handle errors with a nicer dialog.