When the server encounters an error during the execution of a program, it calls the program again, indicating the error condition in the control block field flag_value. The program then does one of the following, indicating its response in the action_value field:
Messages are retrieved by the client application before the processing of an answer set, or after the completion of answer set processing.
Only the action_values for returning a message, or for exiting, are valid after the server has reported an error. Any other action_value returned by the program causes the server to end without further calls to the program. If the program does return another action_value, the server attempts to report the program's incorrect behavior to the client application using a server-initiated message.
The following figure illustrates the correct error handling sequence. In the figure, the following flag_values are shown:
1 Indicates the first call to the program.
0 Indicates a subsequent call to the program, without an error.
606 Indicates an error.
The program's choices when it receives the error code 606 are also illustrated.
iWay Software |