ILE C/C++ Programmer's Guide

Unmonitored Exceptions and Unhandled Exceptions

When an unmonitored exception occurs, the program that is running issues a function check and sends a message to the job log. If you are in debug mode and the modules of the program were created with debug data, the ILE source debugger displays the appropriate module and, if necessary, the program is added to debug mode.

When an unhandled function check occurs, ILE transfers control to the caller of the call stack entry that represents a boundary for the application. This call stack entry is known as a control boundary.

For more information about control boundaries, see:

For detailed information about the default treatment for unhandled exceptions, see ILE Concepts.

Example of ILE C Source Code with an Unhandled Exception

Figure 159 shows ILE C source code with an unhandled *ESCAPE exception.

Figure 159. ILE C Source Code with Unhandled Exceptions




void fred(void)
{
char *p = NULL;
*p = 'x'; /* *ESCAPE exception */
}
int main(void)
{
fred();
}

In Figure 159:

  1. An exception is sent to the fred() function.
  2. The main() function is the control boundary.
    Note:
    For illustration, many of the examples refer to the main() function as a control boundary. If a program is running in a *NEW activation group, the program entry procedure (PEP) is the control boundary for the program.
  3. The fred() function has no exception handlers therefore the exception is percolated to main().
  4. Because the main() function has no exception handlers and main() is a control boundary, the system takes the default action.
  5. Because the exception is of type *ESCAPE, a function check is sent to the fred() function.
    Note:
    For information about actions taken for other types of exceptions, see Exception Messages.
  6. The function check percolates to function main(), and again the default is taken.
  7. Because the exception is of type function check, the call stack entries of the main() and fred() functions are cancelled and the CEE9901 exception is sent to the caller of function main().


[ Top of Page | Previous Page | Next Page | Table of Contents ]