Api Error Handling
Standardized API error responses with status codes, request IDs, logging, and circuit breakers for production services.
- CCM score
- 51 of 100
- skills.sh installs
- 463
- GitHub stars
- 257
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers the standard error response shape with code, message, status, requestId, timestamp, and per-field details
- Includes a Node.js
ApiErrorclass with badRequest, notFound, and unauthorized factories plus a global Express error handler - Enforces hiding internal error messages and stack traces from clients on 5xx responses while logging them server-side
- Provides a circuit breaker and a Python Flask reference covering custom exceptions, exponential-backoff retries, and Sentry integration
Install
$ npx -y skills add secondsky/claude-skills --skill api-error-handling -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
API Error Handling
Implement robust error handling with standardized responses and proper logging.
Standard Error Response Format
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request parameters",
"status": 400,
"requestId": "req_abc123",
"timestamp": "2025-01-15T10:30:00Z",
"details": [
{ "field": "email", "message": "Invalid email format" }
]
}
}
Error Class (Node.js)
class ApiError extends Error {
constructor(code, message, status = 500, details = null) {
super(message);
this.code = code;
this.status = status;
this.details = details;
}
static badRequest(message, details) {
return new ApiError('BAD_REQUEST', message, 400, details);
}
static notFound(resource) {
return new ApiError('NOT_FOUND', `${resource} not found`, 404);
}
static unauthorized() {
return new ApiError('UNAUTHORIZED', 'Authentication required', 401);
}
}
Details
- Repository
- github.com/secondsky/claude-skills
- Categories
- Backend & APIs, Go, Python
- First seen
- Jun 3, 2026
Questions
What does the api-error-handling skill do?
The api-error-handling skill implements standardized API error responses with proper status codes, logging, and user-friendly messages. It gives a Node.js ApiError class, a global error handler, and a circuit breaker pattern for error recovery.
How do I install the api-error-handling skill?
Run npx -y skills add secondsky/claude-skills --skill api-error-handling -y in your project to install the api-error-handling skill. After that, the agent can apply its consistent error format with request IDs to the API endpoints you build.
Who should use api-error-handling?
The api-error-handling skill is for developers building production APIs, implementing error recovery patterns, or integrating error monitoring services. It covers Python Flask error handling and Sentry integration in its reference file.
Does api-error-handling need any tools or accounts?
The api-error-handling SKILL.md lists no accounts or API keys. Its Node.js examples assume an Express-style app with a logger and request IDs, and its Python and Sentry material lives in a separate reference file.
More from secondsky/claude-skills
All 116- Sequential Thinking458
- Bun Nextjs452
- Websocket Implementation449
- Mobile App Debugging448
- Root Cause Tracing448
- App Store Deployment447
- Recommendation Engine447
- Seo Keyword Cluster Builder447
- Push Notification Setup446
- Drizzle Orm D1443
- Api Pagination442
- Api Response Optimization442
- Api Filtering Sorting440
- Bun Drizzle Integration440
- Defense In Depth Validation439
- Session Management438
- Bun Runtime437
- Nuxt Production434
- Ultracite434
- Bun Docker433
- Bun Tanstack Start433
- Api Gateway Configuration430
- Nuxt Ui V4430
- Oauth Implementation430
Similar to Api Error Handling
More Backend & APIserror-handling-standardizerpatricio0312rev/skills270 installsTyped error classes, central Express-style middleware, and structured logging that keeps stack traces out of client responses.
express-rest-apipluginagentmarketplace/custom-plugin-nodejs905 installsProduction-ready Express.js REST API patterns covering routing, middleware, validation, and centralized error handling.
error-handlingaffaan-m/ecc9.1K installsPatterns for typed errors, retries, circuit breakers, and user-facing failure messages across TypeScript, Python, and Go.
error-handling-patternswshobson/agents24.1K installsCross-language error handling guide covering exceptions, Result types, propagation, and graceful degradation for resilient applications.
nodejs-backend-patternswshobson/agents51.1K installsProduction-ready Node.js backend patterns for Express or Fastify services, REST, GraphQL, and microservices.
expressjs-developmentmanutej/luxor-claude-marketplace568 installsComprehensive Express.js guide covering routing, middleware, request handling, error handling, and production REST APIs.