Using Exceptions

There are three primary ways to use the exception classes:

  1. Certain functions in IBM class libraries throw exceptions that are derived from the IException class. If you are familiar with the characteristics of the exception classes, you can take advantage of this knowledge to make code that uses the IBM class libraries more robust.
  2. You can both throw and catch exceptions in your own code. The exception classes provide a convenient way to package information about an exception.
  3. You can derive your own exception classes.


The Exceptions Mechanism


Using Throw Macros
Interpreting Exceptions
Using Assertion Macros
Using try and catch
Rethrowing Exceptions
Deriving Your Own Exceptions
Tracing Exceptions