An error code is a value returned to provide context on why an error occurred. Error codes are often provided in lieu of an error message for the sake of brevity or consistency.
Error codes are often provided in contexts where providing specific error messages would be costly, too varied, or redundant. Tables of error codes are often provided with the full text of the error messages so that users can find a full explanation of the cause of the error.
Error code can be easily programmatically handled, unlike error messages, which can be unpredictable or sometime impossible to rely on (for example, when they are translated, and thus different for each language).