Error code

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Sjö (talk | contribs) at 18:48, 22 October 2022 (Reverted edits by 2A00:1FA0:487A:9AFA:CF40:F80E:814:A14B (talk) to last version by IsaacIsCoding). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

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.[1] They are also commonly found in consumer electronics and devices when they attempt to do something they cannot do (e.g., dividing by zero) or fail to do and they can be passed off to error handlers that determine what action to take.

In vehicles, error codes are five-digit codes that pinpoint a particular car fault. Car owners can make use of an on-board diagnostics scanner to identify a trouble code. The five-digit Diagnostic trouble code typically consists of one letter and four numbers (e.g. P0123)

In consumer products

The error code E74. Above the large E 74 code is the message "System Error. Contact Xbox Customer Support." repeated in different languages.
Error E74 on the Xbox 360, symbolizing a hardware failure.

Error codes can also be used to specify an error, to simplify research into the cause and how to fix it. This is commonly used in 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 hexadecimal numbers, others use alphanumeric codes and some use a phrase describing the error.

In computing

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

Network protocols typically support returning status codes. In the TCP/IP stack, it's a common feature of higher level protocols. For example:

In Automobiles

Error codes[2] in automobiles indicate to a driver or car mechanic what is wrong with a vehicle before repair(s) are initiated. A car is liable to display as many fault codes as possible on the OBD-II scanner, it all depends on the state of the engine system.

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.

See also

References

  1. ^ "What is an Error Code?". www.computerhope.com. Retrieved 2020-01-22.
  2. ^ "Error Codes - Car Automotives". Retrieved 2022-08-27.

External links