Error code

Last updated

In computing, an error code (or a return code) is a numeric or alphanumeric code that indicates the nature of an error and, when possible, why it occurred. [1] Error codes can be reported to end users of software, returned from communication protocols, or used within programs as a method of representing anomalous conditions.

Contents

In consumer products

Error E74 on the Xbox 360, indicating a hardware failure Error-code-e74.jpg
Error E74 on the Xbox 360, indicating a hardware failure

Error codes are commonly encountered on displays of consumer electronics to users in order to communicate or specify an error. They are commonly reported by consumer electronics when users bring electronics to perform tasks that they cannot do (e.g., dividing by zero), or when the program within a device encounters an anomalous condition.

Error codes reported by consumer electronics are used to help diagnose and repair technical problems. An error code can be communicated to relevant support staff to identify potential fixes, or can simplify research into the cause of an error.

There is no definitive format for error codes, meaning that error codes typically differ from/between products and or companies.

In computer programming

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 the Windows operating system communicates error codes to the user.

Error codes can be used within a computer program to represent an anomalous condition. A computer program can take different actions depending on the value of an error code.

Different programming languages, operating systems, and programming environments often have their own conventions and standards for the meanings and values of error codes. Examples include:

The usage of error codes as an error handling strategy is often contrasted against using exceptions for error handling. [7] [8]

In communication protocols

Communication protocols typically define a standard set of error codes, as a means of communicating the status or result of an operation between the entities in the system.

Several high-level protocols in the TCP/IP stack, such as HTTP, FTP, and SMTP, define their own standard sets of error codes:

In automobiles

Error codes in automobiles, sometimes referred to as trouble codes, indicate to a driver or car mechanic what is wrong with a vehicle before repairs are initiated.[ citation needed ]

In vehicles with CAN buses, error codes are often five-digit codes that pinpoint a particular car fault. Car owners can make use of an on-board diagnostics scanner or an owner's manual to identify the meaning of a trouble code. Five-digit diagnostic trouble codes typically consist of one letter and four numbers (e.g. P0123).[ citation needed ]

See also

Related Research Articles

The File Transfer Protocol (FTP) is a standard communication protocol used for the transfer of computer files from a server to a client on a computer network. FTP is built on a client–server model architecture using separate control and data connections between the client and the server. FTP users may authenticate themselves with a plain-text sign-in protocol, normally in the form of a username and password, but can connect anonymously if the server is configured to allow it. For secure transmission that protects the username and password, and encrypts the content, FTP is often secured with SSL/TLS (FTPS) or replaced with SSH File Transfer Protocol (SFTP).

In computing and computer programming, exception handling is the process of responding to the occurrence of exceptions – anomalous or exceptional conditions requiring special processing – during the execution of a program. In general, an exception breaks the normal flow of execution and executes a pre-registered exception handler; the details of how this is done depend on whether it is a hardware or software exception and how the software exception is implemented.

<span class="mw-page-title-main">Serial port</span> Communication interface transmitting information sequentially

On computers, a serial port is a serial communication interface through which information transfers in or out sequentially one bit at a time. This is in contrast to a parallel port, which communicates multiple bits simultaneously in parallel. Throughout most of the history of personal computers, data has been transferred through serial ports to devices such as modems, terminals, various peripherals, and directly between computers.

Berkeley sockets is an application programming interface (API) for Internet sockets and Unix domain sockets, used for inter-process communication (IPC). It is commonly implemented as a library of linkable modules. It originated with the 4.2BSD Unix operating system, which was released in 1983.

UUCP is a suite of computer programs and protocols allowing remote execution of commands and transfer of files, email and netnews between computers.

In computer programming, standard streams are preconnected input and output communication channels between a computer program and its environment when it begins execution. The three input/output (I/O) connections are called standard input (stdin), standard output (stdout) and standard error (stderr). Originally I/O happened via a physically connected system console, but standard streams abstract this. When a command is executed via an interactive shell, the streams are typically connected to the text terminal on which the shell is running, but can be changed with redirection or a pipeline. More generally, a child process inherits the standard streams of its parent process.

<span class="mw-page-title-main">Newline</span> Special characters in computing signifying the end of a line of text

A newline is a control character or sequence of control characters in character encoding specifications such as ASCII, EBCDIC, Unicode, etc. This character, or a sequence of characters, is used to signify the end of a line of text and the start of a new one.

In computing, end-of-file (EOF) is a condition in a computer operating system where no more data can be read from a data source. The data source is usually called a file or stream.

In computer programming, a magic number is any of the following:

<span class="mw-page-title-main">Wget</span> Computer command line program for downloading

GNU Wget is a computer program that retrieves content from web servers. It is part of the GNU Project. Its name derives from "World Wide Web" and "get". It supports downloading via HTTP, HTTPS, and FTP.

errno.h is a header file in the standard library of the C programming language. It defines macros for reporting and retrieving error conditions using the symbol errno.

<span class="mw-page-title-main">Not a typewriter</span> Unix error code

In computing, "Not a typewriter" or ENOTTY is an error code defined in the errno.h found on many Unix systems. This code is now used to indicate that an invalid ioctl number was specified in an ioctl system call.

In computer programming, an inline assembler is a feature of some compilers that allows low-level code written in assembly language to be embedded within a program, among code that otherwise has been compiled from a higher-level language such as C or Ada.

In computing, ioctl is a system call for device-specific input/output operations and other operations which cannot be expressed by regular file semantics. It takes a parameter specifying a request code; the effect of a call depends completely on the request code. Request codes are often device-specific. For instance, a CD-ROM device driver which can instruct a physical device to eject a disc would provide an ioctl request code to do so. Device-independent request codes are sometimes used to give userspace access to kernel functions which are only used by core system software or still under development.

A network socket is a software structure within a network node of a computer network that serves as an endpoint for sending and receiving data across the network. The structure and properties of a socket are defined by an application programming interface (API) for the networking architecture. Sockets are created only during the lifetime of a process of an application running in the node.

In computer science and computer programming, system time represents a computer system's notion of the passage of time. In this sense, time also includes the passing of days on the calendar.

brk and sbrk are basic memory management system calls used in Unix and Unix-like operating systems to control the amount of memory allocated to the data segment of the process. These functions are typically called from a higher-level memory management library function such as malloc. In the original Unix system, brk and sbrk were the only ways in which applications could acquire additional data space; later versions allowed this to also be done using the mmap call.

The MySQLi Extension is a relational database driver used in the PHP scripting language to provide an interface with MySQL databases.

The Ident Protocol, specified in RFC 1413, is an Internet protocol that helps identify the user of a particular TCP connection. One popular daemon program for providing the ident service is identd.

A communication protocol is a system of rules that allows two or more entities of a communications system to transmit information via any variation of a physical quantity. The protocol defines the rules, syntax, semantics, and synchronization of communication and possible error recovery methods. Protocols may be implemented by hardware, software, or a combination of both.

References

  1. "What is an Error Code?". ComputerHope.com. Retrieved 2020-01-22.
  2. "Xbox Support". support.xbox.com. Retrieved 2023-03-12.
  3. intro(2)    Version 7 Unix Programmer's Manual
  4. errno(3)    Linux Programmer's Manual – Library Functions
  5. intro(2)    Solaris 11.4 System Calls Reference Manual
  6. "[MS-ERREF]: Overview". learn.microsoft.com. 30 March 2020. Retrieved 2023-03-12.
  7. TylerMSFT (17 October 2022). "Modern C++ best practices for exceptions and error handling". Learn.Microsoft.com. Retrieved 2023-03-12.
  8. "Standard C++". IsoCpp.org. Retrieved 2023-03-12.