[ Previous | Next | Contents | Glossary | Home | Search ]
The graPHIGS Programming Interface : Subroutine Reference

GPEXIT - Specify an Error Exit and Error Threshold

GPEXIT (error-routine, severity)

Purpose

Use GPEXIT to specify a second-level error handler to receive control at the end of a graPHIGS API subroutine call if an error of at least the specified severity is encountered.

The severity of an error can be assigned by the first-level error handler (see Define Error Handling [GPEHND] [page GPEHND - Define Error Handling Subroutine]) subroutine, which receives control before the second-level error handler.

If a value of zero or less is specified for the severity parameter of this subroutine, the error exit is invoked after every call to the graPHIGS API If a severity level of 17 or more is specified, the error exit is never invoked.

When the error severity threshold is zero, your second-level error exit routine should perform the following steps to prevent infinite loops:

  1. Set the error severity threshold to 17 using GPEXIT to prevent the graPHIGS API from calling your second-level error exit.

  2. Call any graPHIGS API subroutine. Note that because the severity threshold is 17, your second-level error exit will not be called again.

  3. Reset the error severity threshold to zero before returning control to the graPHIGS API Note that the graPHIGS API will not transfer control to your second-level error exit after a call to GPEXIT.
  4. The default error exit can be reset by specifying an error exit address consisting of a fullword binary zero.

    Control is returned to the application statement following the one which invoked the graPHIGS API A second-level error handler can call any graPHIGS API subroutine except the Error Logging (GPELOG) subroutine.

    Parameters

    error-routine -- specified by user, fullword integer

    The address of the routine receiving control when an error of the specified severity or greater is encountered.

    severity -- specified by user, fullword integer

    A fullword integer indicating the minimum level of severity (severity threshold) at which the error routine is called.

    Error Codes

    None

    Related Subroutines

    GPEHND
    Define Error Handling Subroutine

    RCP code

    201337862 (X'0C002C06')



    [ Previous | Next | Contents | Glossary | Home | Search ]