Design structured error codes and error handling for APIs. Create error catalogs with codes, messages, HTTP status mappings, and client-friendly error responses.
Design structured error handling for APIs and applications.
{
"error": {
"code": "VAL_003",
"message": "Email address is invalid",
"details": [{"field": "email", "reason": "must be a valid email"}],
"request_id": "req_abc123"
}
}