IFERROR Test result code and conditionally branch to label |
Top Previous Next |
This script command checks the result of the previously executed command to see if IFERRORxx [ rcode ] is true. If so, the script file branches to [ label ], otherwise execution continues with the next command.
The [ rcode ] may be omitted if you do not wish to test for a specific error condition. A value of 1 is assumed, which results in testing for any error condition. The following variations of the IFERROR command are supported:
Syntactically, no space is permitted to the left of the ‘!’, '=', '<' or '>' symbols, and a space is required to the right of these symbols.
Consider the following examples.
;; if result code is greater than 1046 then branch to label ;; 'next', else continue with the next line IFERROR> 1046 goto next ;; if result code equals predefined $ERROR variable then branch ;; to label 'next' IFERROR= $ERROR_CONNECT_TIMEOUT goto next
Related Command(s): LOOPIF, GOTO See also: Script File Result Codes |