About Error Management
Successful completion of most Control Program functions is indicated by
an error return code of 0. In the event of an error, Control Program functions
usually return an error code that has a non-zero integer value. The non-zero
value equates to a symbolic error identifier in the include file, BSEERR.H.
The symbolic identifiers indicate the cause of the error. For example, a
return code of 2 from DosOpen equates
to the symbolic identifier ERROR_FILE_NOT_FOUND; the cause of the error
is that the file being opened cannot be found.
DosErrClass and DosError
are supplied to assist in error processing.
- DosErrClass
takes as input a non-zero return value that was received from any control-program
function. (Any return value other than 0 indicates that an error occurred.)
The output is a classification of the error and a recommended action. Depending
on the application, the recommended action could be followed, or a specific
recovery action could be performed.
- DosError enables
an application to prevent OS/2 from displaying a default error message in
a pop-up window when either a hard error or a software exception occurs.
[Back: Error Management]
[Next: Classifying Return Values]