Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| en:docs:fapi:doserrclass [2021/08/20 04:41] – created prokushev | en:docs:fapi:doserrclass [2021/11/04 13:55] (current) – prokushev | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| {{page> | {{page> | ||
| + | |||
| + | ====== DosErrClass ====== | ||
| + | |||
| This call helps OS/2 applications respond to error codes (return codes) received from OS/2. | This call helps OS/2 applications respond to error codes (return codes) received from OS/2. | ||
| - | ==Syntax== | + | ===== Syntax |
| - | | + | <code c> |
| + | DosErrClass (Code, Class, Action, Locus) | ||
| + | </ | ||
| - | ==Parameters== | + | ===== Parameters ===== |
| - | ;Code (USHORT) - input : Error code returned by an OS/2 function. | + | |
| - | ;Class (PUSHORT) - output : Address of the classification of an error. | + | |
| - | ;Action (PUSHORT) - output : Address of the action for an error. | + | |
| - | ;Locus (PUSHORT) - output : Address of the origin of an error. | + | |
| - | ==Return Code== | + | * Code ([[USHORT]]) - input : Error code returned by an OS/2 function. |
| - | ;rc (USHORT) - return: | + | * Class ([[PUSHORT]]) - output : Address of the classification of an error. |
| - | * 0 NO_ERROR | + | * Action ([[PUSHORT]]) - output : Address of the action for an error. |
| + | * Locus ([[PUSHORT]]) - output : Address of the origin of an error. | ||
| + | |||
| + | ===== Return Code ===== | ||
| + | |||
| + | rc ([[USHORT]]) - return: | ||
| + | |||
| + | | ||
| + | |||
| + | ===== Remarks ===== | ||
| - | ==Remarks== | ||
| The input is a return code returned from another function call, and the output is a classification of the return and recommended action. Depending on the application, | The input is a return code returned from another function call, and the output is a classification of the return and recommended action. Depending on the application, | ||
| The following values are returned in Class, Action, and Locus: | The following values are returned in Class, Action, and Locus: | ||
| - | {|class=" | ||
| - | |+Class Definitions | ||
| - | !VALUE||MNEMONIC||DESCRIPTION | ||
| - | |- | ||
| - | |1||OUTRES||Out of resources | ||
| - | |- | ||
| - | |2||TEMPSIT||Temporary situation | ||
| - | |- | ||
| - | |3||AUTH||Authorization failed | ||
| - | |- | ||
| - | |4||INTRN||Internal error | ||
| - | |- | ||
| - | |5||HRDFAIL||Device hardware failure | ||
| - | |- | ||
| - | |6||SYSFAIL||System failure | ||
| - | |- | ||
| - | |7||APPERR||Probable application error | ||
| - | |- | ||
| - | |8||NOTFND||Item not located | ||
| - | |- | ||
| - | |9||BADFMT||Bad format for call/data | ||
| - | |- | ||
| - | |10||LOCKED||Resource/ | ||
| - | |- | ||
| - | |11||MEDIA||Incorrect media, CRC error | ||
| - | |- | ||
| - | |12||ALREADY||Resource/ | ||
| - | |- | ||
| - | |13||UNK||Unclassified | ||
| - | |- | ||
| - | |14||CANT||Can' | ||
| - | |- | ||
| - | |15||TIME||Timeout | ||
| - | |} | ||
| - | {|class=" | ||
| - | |+Action Definitions | ||
| - | !VALUE||MNEMONIC||DESCRIPTION | ||
| - | |- | ||
| - | |1||RETRY||Retry immediately | ||
| - | |- | ||
| - | |2||DLYRET||Delay and retry | ||
| - | |- | ||
| - | |3||USER||Bad user input - get new values | ||
| - | |- | ||
| - | |4||ABORT||Terminate in an orderly manner | ||
| - | |- | ||
| - | |5||PANIC||Terminate immediately | ||
| - | |- | ||
| - | |6||IGNORE||Ignore error | ||
| - | |- | ||
| - | |7||INTRET||Retry after user intervention | ||
| - | |} | ||
| - | {|class=" | ||
| - | |+Locus Definitions | ||
| - | !VALUE||MNEMONIC||DESCRIPTION | ||
| - | |- | ||
| - | |1||UNK||Unknown | ||
| - | |- | ||
| - | |2||DISK||Random access device such as a disk | ||
| - | |- | ||
| - | |3||NET||Network | ||
| - | |- | ||
| - | |4||SERDEV||Serial device | ||
| - | |- | ||
| - | |5||MEM||Memory | ||
| - | |} | ||
| - | ===Family API Considerations=== | + | ^ VALUE ^ MNEMONIC ^ DESCRIPTION ^ |
| + | |1|OUTRES|Out of resources| | ||
| + | |2|TEMPSIT|Temporary situation| | ||
| + | |3|AUTH|Authorization failed| | ||
| + | |4|INTRN|Internal error| | ||
| + | |5|HRDFAIL|Device hardware failure| | ||
| + | |6|SYSFAIL|System failure| | ||
| + | |7|APPERR|Probable application error| | ||
| + | |8|NOTFND|Item not located| | ||
| + | |9|BADFMT|Bad format for call/ | ||
| + | |10|LOCKED|Resource/ | ||
| + | |11|MEDIA|Incorrect media, CRC error| | ||
| + | |12|ALREADY|Resource/ | ||
| + | |13|UNK|Unclassified| | ||
| + | |14|CANT|Can' | ||
| + | |15|TIME|Timeout| | ||
| + | |||
| + | ^ VALUE ^ MNEMONIC ^ DESCRIPTION ^ | ||
| + | |1|RETRY|Retry immediately| | ||
| + | |2|DLYRET|Delay and retry| | ||
| + | |3|USER|Bad user input - get new values| | ||
| + | |4|ABORT|Terminate in an orderly manner| | ||
| + | |5|PANIC|Terminate immediately| | ||
| + | |6|IGNORE|Ignore error| | ||
| + | |7|INTRET|Retry after user intervention| | ||
| + | |||
| + | ^VALUE^MNEMONIC^DESCRIPTION^ | ||
| + | |1|UNK|Unknown| | ||
| + | |2|DISK|Random access device such as a disk| | ||
| + | |3|NET|Network| | ||
| + | |4|SERDEV|Serial device| | ||
| + | |5|MEM|Memory| | ||
| + | |||
| + | ==== Family API Considerations ==== | ||
| Some options operate differently in the DOS mode than in the OS/2 mode. Therefore, the following considerations apply to DosErrClass when coding for the DOS mode: | Some options operate differently in the DOS mode than in the OS/2 mode. Therefore, the following considerations apply to DosErrClass when coding for the DOS mode: | ||
| When DosErrClass is called by a family application, | When DosErrClass is called by a family application, | ||
| - | ==Bindings== | + | ===== Bindings ===== |
| - | ===C=== | + | |
| - | <PRE> | + | ==== C ==== |
| + | |||
| + | <code c> | ||
| #define INCL_DOSMISC | #define INCL_DOSMISC | ||
| Line 105: | Line 84: | ||
| USHORT | USHORT | ||
| - | </PRE> | + | </code> |
| - | ===MASM=== | + | ==== MASM ==== |
| - | <PRE> | + | |
| + | <code asm> | ||
| EXTRN DosErrClass: | EXTRN DosErrClass: | ||
| INCL_DOSMISC | INCL_DOSMISC | ||
| Line 117: | Line 97: | ||
| PUSH@ WORD Locus ; | PUSH@ WORD Locus ; | ||
| CALL | CALL | ||
| + | |||
| + | </ | ||
| Returns WORD | Returns WORD | ||
| - | </ | ||
| - | ==Example Code== | + | |
| + | ===== Example Code ===== | ||
| This example attempts to delete a non-existent file. The error returned is then plugged into DosErrClass for more information about the error and what actions should be taken. | This example attempts to delete a non-existent file. The error returned is then plugged into DosErrClass for more information about the error and what actions should be taken. | ||
| - | <PRE> | + | <code c> |
| #define INCL_DOSQUEUES | #define INCL_DOSQUEUES | ||
| Line 141: | Line 124: | ||
| & | & | ||
| & | & | ||
| - | </PRE> | + | </code> |
| {{page> | {{page> | ||




