hello-errors

Implements error handling, logging, retry logic, and graceful degradation patterns in code.

702|99|Updated Sep 26, 2025
One-click install
npx skills add https://github.com/hellowind777/helloagents --skill hello-errors
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hello-errors
Source: https://github.com/hellowind777/helloagents/tree/main/skills/hello-errors
Command: npx skills add https://github.com/hellowind777/helloagents --skill hello-errors

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Code often ships with inconsistent error responses, swallowed exceptions, missing timeouts, and leaked internal details, making failures hard to debug and unsafe for users.

Core Features & Use Cases

  • Error Classification: Distinguishes expected errors (validation failures, missing resources) from unexpected ones (system outages) and handles each appropriately.
  • Structured Error Responses: Enforces a unified { code, message, details? } format with accurate HTTP status codes and no leaked stack traces, SQL, or file paths.
  • Logging & Recovery Standards: Requires structured JSON logs with sanitized sensitive data, plus timeouts, exponential-backoff retries, idempotent operations, circuit breakers, and graceful degradation.
  • Use Case: When building an API endpoint that calls a third-party payment service, apply this Skill to add timeouts, retry with backoff, return a clean 4xx/5xx error format, and log failures without exposing tokens.

Quick Start

Use the hello-errors skill to review and improve the error handling in my API service code.

Frequently Asked Questions about hello-errors

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure error responses in a REST API?

Use a unified error format like { code, message, details? } with accurate HTTP status codes: 4xx for client errors and 5xx for server errors. Keep error codes enumerable so frontends can handle them programmatically, and never expose stack traces, SQL, or file paths to users.

How should I handle expected vs unexpected errors in code?

Classify errors before writing code: expected errors like validation failures get friendly messages returned normally, while unexpected errors like system outages get logged with a generic user-facing response. Only wrap code in try-catch when you can actually handle the exception.

What is the best retry strategy for external API calls?

Combine a timeout with exponential-backoff retries, capped at three attempts. Design critical operations to be idempotent so retries are safe, and add a circuit breaker that fails fast after consecutive failures exceed a threshold.

What should error logs contain for production debugging?

Use structured JSON logs with timestamp, level, and context. Error-level logs should include the stack trace, request ID, and user context, but sensitive data like passwords, tokens, and ID numbers must be masked before logging.

Why is swallowing exceptions with empty catch blocks dangerous?

Empty catch blocks create silent failures that hide bugs and make systems appear healthy while functionality is broken. Every caught exception should be handled, logged, or rethrown, and silent degradation or fallback paths should be avoided.