Any application needs to handle errors that occur at runtime. Unfortunately it can be difficult to resolve all the possible errors that can occur. However, it is always a good idea to try to create code that can resolve most errors, so that the user doesn’t have to worry about them. You should then attempt to catch the rest of them and display an error message with detailed information to the user about how to continue from this point. The overall purpose of error handlers is to allow the program to gracefully recover from things going awry. This is especially important when dealing with relational databases. Since you are passing through multiple layers of technology, there are many places that an application can break. Although this chapter is about handling data-related exceptions, I will cover the basics for handling all kinds of exceptions briefly.
KeywordsLine Number Exception Handler Error Handling Normal Code Catch Statement
Unable to display preview. Download preview PDF.