#
CwErrorFun

### Syntax:

    sFunName = CwErrorFun()

            sFunName        (string) The name of the P>G PRO function or
                            procedure in which the last exception was raised.

### Description:

P>G PRO responds to errors by raising a syntax error condition. Normally, this is sufficient. However, occasionally a script must be able to recover from an error. In that case, the script must use "SIGNAL ON SYNTAX" to trap the error and it can become extremely useful to know more about the error.

This function returns the name of the P>G PRO call in which the error occurred. If the error did not occur inside a P>G PRO call, this function returns the empty string. In this way, it can be used to determine if a trapped error is a result of a P>G PRO error or other REXX error.

See the section on error handling for more details.

### Example:

    /* A procedure that exits the script if the last error was not
       raised by P>G PRO. */

    callfail:procedure

    if CwErrorFun() = '' then do
            say 'Non-photographics syntax error.'
            exit
            end
    return

Functions by NAME | Index | Functions by PURPOSE