Debugging can become a burden if you do not have meaningful error messages or if you do not handle errors in the correct way. In this chapter, we are going to focus on how to handle errors, starting with how to catch them and how to describe what an error is and is not. Without meaningful error messages, catching an error is usually hard to debug. Note that error messages should only describe the error and should not expose any sensitive data inside the error. We are going to talk about how to write understandable error messages with minimal information. At the end of the chapter, we will explore logging mechanisms in order to track what is going on in our web services, use them for attack detection, and to improve our code base in terms of quality and validity.
The following topics will be covered in this chapter:
- Error handling
- Error messages
- Logging...