[iOS] Improved error handling.