Guardian Procedure Errors and Messages Manual

Procedure Errors
Procedure errors are values returned to your program after your program calls procedures such
as file-system procedures. Your application program must test for possible errors and take
appropriate action when necessary.
Your program detects procedure errors in two ways, depending on the procedure being called.
Errors returned by D-series procedures are not in the same format as those returned by C-series
procedures. The names of D-series procedures can be recognized by their trailing underscore; the
names of most C-series procedures do not contain the underscore character.
G-Series and Later Procedure Errors
Many G-series procedures return procedure error values through an output parameter of the
procedure. For these procedures, you check the value of the error or status parameter to determine
whether an error occurred. For example, an error returned in the error parameter of the procedure
FILE_CREATE_ is a simple file-system error code giving the status of the operation.
Some G-series procedures return additional information through an error-item or error-detail
parameter. Depending on the procedure, this information can supply the ordinal number of the
parameter in error or other detailed information about the error encountered.
All G-series operating-system procedures have an integer returned value called error or status. If
the error has associated information, the extra information is returned in an integer error-detail
output parameter. If error is a returned value, it is always possible to obtain it or return it. Bounds
checking is not required.
When error-detail is used, most error values share the error designations shown in Table 1.
Table 1 Error Designations
MeaningValue
Successful operation0
File-system error other than 0, 2, or 3; error-detail contains the file-system error number1
Parameter error2
Bounds error on reference parameter3
Other error; error-detail can contain additional information4 - n
The following four G-series file information procedures are available for checking on error conditions:
FILE_GETINFO_
FILE_GETINFOBYNAME_
FILE_GETINFOLIST_
FILE_GETINFOLISTBYNAME_
These procedures are described in the Guardian Procedure Calls Reference Manual. For information
regarding their use in obtaining file-system error information, see “File-System Errors”.
C-Series Procedure Errors
C-series procedures continue to use condition codes; condition codes are not used by D-series
procedures. A condition code of equal (CCE) indicates success; a condition code of less than (CCL)
or greater than (CCG) indicates that a problem occurred and that the error must be retrieved. The
completion of a read associated with a C-series system message returns a condition code of greater
than (CCG) and file-system error 6 from the FILEINFO procedure.
As for the case for previous releases of the operating system, you use FILEINFO to obtain the error
code. You must use the file number form of the FILEINFO procedure to obtain information about
16 Introduction