This article needs additional citations for verification. (January 2021)
This article's tone or style may not reflect the encyclopedic tone used on Wikipedia. (June 2021)
In computer programming, a return code or an error code is a numeric or alphanumeric code that is used to determine the nature of an error and why it occurred. In the C programming language you can find many error codes defined under the header file <error.h>. They are also commonly found in consumer electronics and devices when they attempt to do something they can't do (ie, dividing by zero) or fail to do. They can also passed off to error handlers that determine what action to take.
In consumer products
Error codes can also be used to specify an error, and simplify research into the cause and how to fix it. This is commonly used by consumer products when something goes wrong, such as the cause of a Blue Screen of Death, to make it easier to pinpoint the exact problem the product is having.
There is no definitive form of an error code. Some styles use decimal or hexidecimal numbers. Others use alphanumeric codes, while others use a phrase describing the error.
Error codes in computers can be passed to the system itself, to judge how to respond to the error. Often error codes come synonymous with an exit code or a return value. The system may also choose to pass the error code to its user(s). The Blue screen of death is an example of how a popular operating system communicates error codes to the user.
In networking software
- List of HTTP status codes
- List of FTP server return codes
- Simple Mail Transfer Protocol#Protocol overview
Error codes and exception handling
Error codes are passed to exception handling in programming languages that support it. These are passed to log files and the parent process to determine what action to take.
- errno.h, a header file in C that defines macros for reporting errors
- Abort (computing)
- Aspect-oriented programming
- Exit status
- Static code analysis
- "What is an Error Code?". www.computerhope.com. Retrieved 2020-01-22.