[Return to Bookshelf] [Contents] [Previous Section] [Next Section] [Index] [Help]


5.1.1 Types of Exceptions

There are two types of exceptions: address exceptions and status exceptions. An exception is initialized as an address exception, but it can be modified (before it is used) by defining a status value for it. Following are the primary differences between address and status exceptions:

Status values used in exceptions can be interpreted, handled, and reported in a universal manner, regardless of which facility defined the status value. Use address exceptions if your code does not have a range of status codes assigned to it. Address exceptions are always unique so you do not risk colliding with another facility's status codes and inadvertently handling the wrong exception. Also, address exceptions are more portable because status codes are likely to be different on each platform.