6100 BSC Programming Manual

Writing Applications that Use 6100 BSC
Recovering from Errors
There are two ways a BSC application finds out about errors:
• A file system call completes with a non-zero condition code.
• A WRITEREAD call completes with a condition code of zero,
but the status field in the application buffer contains
an error code. The status detail field in the buffer
gives more information about the error.
The hierarchy among the different kinds of errors and the
ways they are reported makes for an orderly error trapping
and recovery procedure:
1. The application calls AWAITIO to complete an earlier nowait
request.
2. If the call completed with a condition code other than zero,
the application calls FILEINFO to discover the error.
Appendix A describes each of the file system errors and
the means of recovery.
3. If a WRITEREAD call completed with a condition code of zero,
the application examines the status field in the WRITEREAD
buffer; that field contains a zero or a non-zero status
code. The meanings of the status codes are described later
in this section.
4. If the status field does not contain a zero, or if more
information is needed regarding the outcome of the request,
the application examines the status detail field in the
WRITEREAD buffer. The meanings of the status detail codes
are described later in this section.
Notice that when a WRITEREAD call completes with a condition
code of zero, that doesn't mean the application request
completed without error. It means the request successfully
reached the protocol task, which may or may not have
succeeded in its execution. To find out whether the request
succeeded, you have to examine the WRITEREAD buffer; a value
of zero in the status field means that everything worked.
Sometimes error recovery entails simply repeating the last
request, or making a small correction and then repeating the
request. At other times, it can involve making a new bid for the
line, disconnecting the line and connecting it again, or even
stopping the line with CMI until the problem has been solved.
3-20