Return Code Example
Have the Return Code defined as a 4 digit number where the first digit designates the Priority Level which allows calling jobs to determine the nature of the Return Code (as organized above).
The second digit designates a System Level which identifies where the code was generated.
The last two digits a specific Condition Type which when coupled with the first two digits clearly isolate what has occurred that warrants the Return Code.
Where Priority Codes are defined as:
PRIORITY LEVEL | PRIORITY CODE |
---|---|
INFO | 3 |
WARNING | 4 |
ERROR | 5 |
FATAL | 6 |
Where System Codes are defined as:
SYSTEM LEVEL | SYSTEM CODE |
---|---|
Operating System | 1 |
Memory | 2 |
Storage | 3 |
Network | 4 |
Internet | 5 |
File System | 6 |
Database | 7 |
NoSQL | 8 |
Other | 9 |
Where Type Codes are defined as:
TYPE LEVEL | TYPE CODE |
---|---|
Permission | 01 |
Connection | 02 |
Locate | 03 |
Check | 04 |
Open | 05 |
Close | 06 |
Read | 07 |
Write | 08 |
Create | 09 |
Delete | 10 |
Rename | 11 |
Dump | 20 |
Load | 21 |
Get | 30 |
Put | 31 |
To further illustrate this example, here is how some Return Codes may be used:
RETURN CODE | SAMPLE MESSAGE |
---|---|
3605 | Open File Successful |
4304 | Disk Space is Low |
5701 | Invalid DB Login |
6205 | Insufficient Memory |
Other numbering schemes will work just as well as long as the best practice is to have well defined Return Codes and wide adoption.