Error response payloads should follow a consistent structure. For instance, the payload should be a JSON object with an array of error objects, each containing three fields:
- code: A numeric error code, to be used by the program
- message: A short, human-readable summary of the error
- description: An optional longer, more detailed description of the error
Every error payload must follow this format. This allows developers to write a single function that can process all error messages.