When developing applications, the question is not if errors and bugs will occur, but when they will occur. Building applications is a very complex task and it is nearly impossible to think about all of the cases that might occur during runtime. And even if you think you have thought about everything, then the environment is not behaving as expected, for example, a service is not available or processing a request is taking much more time than expected.
You have two solutions to this problem, which need to be applied at the same time—unit tests and error handling. Unit tests will assure the correct behavior during development time from an application point of view, while error handling helps you to ...