Back to prompts
Create an API error handling playbook for this service: API style: [REST / GRAPHQL / RPC] Language / framework: [STACK] Audience of errors: [CLIENT APPS / PARTNERS / INTERNAL] Existing status code conventions: [CONVENTIONS OR NONE] Logging / observability stack: [TOOLS] Common failure modes: [TIMEOUTS, VALIDATION, AUTH, DEPENDENCIES] Requirements: 1. Define when to use 4xx vs 5xx and how to map domain errors. 2. Specify a stable error payload shape (code, message, details, request_id). 3. Include retry guidance for clients (idempotency, backoff, what not to retry). 4. Cover logging fields and what must never be logged (secrets, PII). 5. Give copy-paste examples for validation, auth, not found, and dependency failure. Deliverables: 1. Error taxonomy table. 2. Example error JSON for four common cases. 3. A short implementation checklist for PR reviewers.
How to use this prompt
- 1Copy the prompt using the button above.
- 2Open your AI tool (ChatGPT, Claude, Midjourney, etc.)
- 3Paste and customize any variables in the prompt.
- 4Generate your result.