Implementing Error Reporting in Your Functions

Do the following if you want to:

To implement automatic calling of the error function when an error is detected, do the following steps.

Warning: Do not put this code in main().

1 Place the name of the function in a character string. For example:
    UCHAR *fname = "my_func"; 
2 Place the call to the initialize module function INIT_MODULE() as the first operable statement in the function:
    INIT_MODULE(fname); 

where fname is the string containing the name of the function.

  where fname is the string containing the name of the function.
3 Set the error code VV_ERR when an error is encountered.
4 Place the call to the exit module function EXIT_MODULE() prior to all returns from the function. This requirement will be simplified if the function is written to have only a single exit. The exit module function is:

EXIT_MODULE(fname);  
  where fname is the string containing the name of the function.
  Warning: If you implement our error system in your functions, be sure that all functions call EXIT_MODULE() before every return. If this condition is not satisfied, the error call log and call stack lists will be in error.

More:

Coding Example for Implementing Error Reporting in Your Functions

Code Before Modifying for VCS Error Reporting System

Code After Modifying for VCS Error Reporting System

Single Exit Point

Automatic Error Checking


Home Contents Previous Next