Chapter 5
Handling Exceptions
In This Chapter
Exploring exception basics
Discovering types of exceptions
Understanding how exceptions propagate
Almost any program has uncommon situations that need to be handled. These situations are sometimes caused by data entry problems. Imagine that a user enters several pieces of information into an online-book-order application. Maybe one or more pieces of information are missing or incorrectly entered. For example, in the case where the person forgot to indicate the shipping method on their order, the application responds with a user-friendly error message, such as You must enter a shipping method for your order. This is an example of user-defined exception handling in action.
You also want to have a nice way to handle programming errors and exceptions so that users don’t see incomprehensible messages such as Unhandled Program Exception — ORA 600. If you have ever encountered a message such as An unexpected program error has occurred. Please contact the help desk and report this problem, you have experience with a program where the designers tried to come up with a general way to handle unexpected situations.
In PL/SQL, you can handle these ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access