Skip to main content

handle-api-errors

Handle API failures with stable classification, safe user feedback, controlled retries, and useful diagnostics. Use when a client or service must turn unreliable responses into predictable behavior.

Datos de origen

Repositorio
protosphinx/sphinxstack
Última actividad en el origen
29 de julio de 2026 a las 13:55
Idioma detectado de SKILL.md
inglés
Estrellas
3
Forks
0

Opciones de instalación

De forma predeterminada está seleccionado el prompt que primero revisa el origen. Puedes cambiar a un comando directo o descargar una copia local.

Revisa los archivos de origen

Lee SKILL.md y los archivos complementarios que muestra SkillsMP antes de decidir si quieres instalarlo.

Explorador de archivos
2 archivos

Mostrando SKILL.md

SKILL.md
Instrucciones de origen · Vista previa de solo lectura
name
handle-api-errors
category
code
description
Handle API failures with stable classification, safe user feedback, controlled retries, and useful diagnostics. Use when a client or service must turn unreliable responses into predictable behavior.
# handle-api-errors Design error paths as part of the API integration, not as an afterthought around the happy path. ## Procedure 1. Inventory transport, timeout, protocol, authentication, authorization, validation, rate-limit, server, and business-rule failures. 2. Define a small internal error model with a stable code, safe message, retryability, and original cause. 3. Parse structured error bodies defensively and preserve status, request ID, and provider code. 4. Give users an actionable message without exposing credentials, internals, or personal data. 5. Retry only transient, safe operations with a limit, exponential backoff, jitter, and server guidance. 6. Emit structured logs and metrics keyed by operation, category, status, and correlation ID. 7. Test malformed bodies, timeouts, cancellations, partial responses, rate limits, and representative 4xx and 5xx cases. 8. Document fallback, escalation, and recovery behavior in the integration report. ## Guardrails - Never retry a non-idempotent operation unless duplication is prevented. - Do not show raw upstream error bodies to users. - Preserve cancellation and timeout distinctions instead of collapsing every failure into “unknown.” ## Done - The error model and user messages are documented and reviewed - Retry behavior is tested against transient and permanent failures - Logs and metrics reconcile each simulated failure with its final outcome
Ver en GitHub