dos12.hlp (Table of Contents; Topic list)
DosErrClass (1.2)
Function Group                                      Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_DOSMISC
 
USHORT DosErrClass(usErrorCode, pusClass, pfsAction, pusLocus)
USHORT usErrorCode;    /* error value for analysis                     */
PUSHORT pusClass;      /* pointer to variable for error classification */
PUSHORT pfsAction;     /* pointer to variable for action               */
PUSHORT pusLocus;      /* pointer to variable for error origin         */
 
The DosErrClass function retrieves a classification of an error value and a
recommended action.
 
The DosErrClass function is a family API function.
 
Parameter    Description
────────────────────────────────────────────────────────────────────────────
 
usErrorCode  Specifies the error value returned by an MS OS/2 function.
 
pusClass     Points to the variable that receives the classification of the
             error value. This parameter can be one of the following
             values:
 
             Value             Meaning
             ───────────────────────────────────────────────────────────────
             ERRCLASS_ALREADY  Action already taken.
 
             ERRCLASS_APPERR   An application error has probably occurred.
 
             ERRCLASS_AUTH     Authorization has failed.
 
             ERRCLASS_BADFMT   Bad format for call data.
 
             ERRCLASS_CANT     Cannot perform requested action.
 
             ERRCLASS_HRDFAIL  A device-hardware failure has occurred.
 
             ERRCLASS_INTRN    An internal error has occurred.
 
             ERRCLASS_LOCKED   Resource or data is locked.
 
             ERRCLASS_MEDIA    Incorrect media; a CRC error has occurred.
 
             ERRCLASS_NOTFND   The item was not located.
 
             ERRCLASS_OUTRES   Out of resources.
 
             ERRCLASS_SYSFAIL  A system failure has occurred.
 
             ERRCLASS_TEMPSIT  This is a temporary situation.
 
             ERRCLASS_TIME     A time-out has occurred.
 
             ERRCLASS_UNK      The error is unclassified.
 
pfsAction    Points to the variable that receives the recommended action for
             the specific error. This parameter can be one of the following
             values:
 
             Value          Meaning
             ───────────────────────────────────────────────────────────────
             ERRACT_ABORT   Terminate in an orderly manner.
 
             ERRACT_DLYRET  Delay and retry.
 
             ERRACT_IGNORE  Ignore the error.
 
             ERRACT_INTRET  Retry after user intervention.
 
             ERRACT_PANIC   Terminate immediately.
 
             ERRACT_RETRY   Retry immediately.
 
             ERRACT_USER    Bad user input; get new values.
 
pusLocus     Points to the variable that receives the error's origin in the
             system. This parameter can be one of the following values:
 
             Value          Meaning
             ───────────────────────────────────────────────────────────────
             ERRLOC_DISK    The error occurred in a random-access device,
                            such as a disk drive.
 
             ERRLOC_MEM     This is a memory-parameter error.
 
             ERRLOC_NET     This is a network error.
 
             ERRLOC_SERDEV  This is a serial-device error.
 
             ERRLOC_UNK     The origin of the error is unknown.
 
Return Value
 
The return value is zero if the function is successful. Otherwise, it is an
error value.
 
Comments
 
The ERRACT_, ERRCLASS_, and ERRLOC_ constants are defined in the bseerr.h
file.
 
Example
 
This example calls the DosQFileMode function to determine the status of the
file a:\abc.exe. If DosQFileMode returns an error, the DosErrClass function
is called to determine the class of the error. The process terminates if the
error is a device-hardware failure──for example, if a drive door is open or
a specified disk drive is nonexistent.
 
USHORT usAttribute, usError, usClass, fsAction, usLocus;
usError = DosQFileMode("a:\\abc.ext", &usAttribute, 0L);
if (usError) {
    DosErrClass(usError,             /* error number            */
        &usClass,                    /* error classification    */
        &fsAction,                   /* recommended action      */
        &usLocus);                   /* error origin            */
    if (usClass == ERRCLASS_HRDFAIL) /* device-hardware failure */
        DosExit(1, EXIT_PROCESS);    /* exits application       */
 
See Also
 
DosError, DosExit, DosQFileMode