6100 ADCCP Programming Manual
Application Tasks
Writing Applications that Use ADCCP
069225 Tandem Computers Incorporated 4–23
Error Recovery There are three levels of errors reported to an application:
File-system errors
Errors unrelated to specific request
Errors related to specific requests
A file-system error is indicated when a file-system call finishes with a nonzero
condition code. To determine the error, the application uses the FILEINFO call to
return the error number.
Errors unrelated to specific requests are detected by the application when a READ call
completes. The application finds the error message in the READ buffer. Errors
reported in the READ buffer are normally line or modem problems perceived by the
protocol task. For example, the number of line errors exceed a threshold prescribed
for the line.
Errors related to specific requests are detected by the application when a WRITEREAD
call completes, and the buffer contains an error message. The application finds the
message in the second byte of the buffer; a nonzero value identifies the error that
occurred. An error in the WRITEREAD buffer signifies that the request issued by your
application was conveyed to the protocol task, but for reasons indicated in the
message, the request could not be satisfied.
The hierarchy among the different kinds of errors and the way the errors are reported
leads to an orderly error trapping and recovery procedure. The order in which an
application should handle errors is:
1. The application calls AWAITIO to complete an earlier nowait request.
2. If the READ or WRITEREAD finishes with a condition code other than zero, the
application calls FILEINFO to discover the error. Recommended ways to recover
from file system errors are described in Appendix A.
3. If a READ call finished with a condition code of zero, the application examines the
buffer, which contains an error or other status message from the protocol task. If a
WRITEREAD call finishes with a condition code of zero, the application examines
the buffer, which may or may not contain an error message from the protocol task.
When a WRITEREAD call finishes with a condition code of zero, the application
request does not necessarily finish without an error. The request may, in fact,
successfully reach the protocol task, which may or may not have succeeded in
executing the request. To find out whether the desired action is taken by the protocol,
you must examine the WRITEREAD buffer; a value of zero in the status field means
that everything worked.
ADCCP error responses vary according to the request. The requests and responses
are described in the Section 6, “Requests and Responses.”