Design API Error Response yang Konsisten

Template error response agar observability dan debugging lebih mudah.

Design API Error Response yang Konsisten
  • debug

Gunakan format error yang konsisten lintas endpoint.

{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Field email is invalid",
    "request_id": "req_abc123"
  }
}

Field request_id sangat membantu korelasi ke log.

EN

(Write English version here)