API Integration in React Native

What is the purpose of error handling in API integration?