Handling errors

To process errors that are returned by functions, reference error numbers by looking up their symbolic names in the syscdcerrcodes table.

About this task

Add code to your application to handle possible error conditions.

Procedure

  1. Declare error code variables for the types of errors that you intend to process separately.
  2. Query the syscdcerrcodes table to find the error number corresponding to each of the symbolic names of the error codes.
  3. Set the error code variables to the error numbers.
  4. Add code to handle each error condition.

What to do next

You can use the cdc_errortext() function to return the error text for a specified symbolic name.