[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6FG378CS3KYJ8FHK7F6B8DZ":3,"skill-same:01M6FG378CS3KYJ8FHK7F6B8DZ":72},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":43,"commitSha":44,"skillDirectory":45,"forksCount":46,"repositoryHtmlUrl":47,"repositoryHomepageUrl":48,"ownerHtmlUrl":49,"ownerBlogUrl":6,"ownerDescription":50,"updatedAt":51,"install":52,"resources":65},"01M6FG378CS3KYJ8FHK7F6B8DZ","api-error-handling",null,"Implements standardized API error responses with proper status codes, logging, and user-friendly messages. Use when building production APIs, implementing error recovery patterns, or integrating error monitoring services.","ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fsecondsky\u002Fclaude-skills\u002Fapi-error-handling\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"api error handling","error handling","error","api","recovery","with","error monitoring","codes","patterns","use","user","status","Production","services","messages","error recovery patterns","monitoring","logging","error recovery","2026-11-10 10:12:30",false,"---\nname: api-error-handling\ndescription: Implements standardized API error responses with proper status codes, logging, and user-friendly messages. Use when building production APIs, implementing error recovery patterns, or integrating error monitoring services.\nlicense: MIT\n---\n\n# API Error Handling\n\nImplement robust error handling with standardized responses and proper logging.\n\n## Standard Error Response Format\n\n```json\n{\n  \"error\": {\n    \"code\": \"VALIDATION_ERROR\",\n    \"message\": \"Invalid request parameters\",\n    \"status\": 400,\n    \"requestId\": \"req_abc123\",\n    \"timestamp\": \"2025-01-15T10:30:00Z\",\n    \"details\": [\n      { \"field\": \"email\", \"message\": \"Invalid email format\" }\n    ]\n  }\n}\n```\n\n## Error Class (Node.js)\n\n```javascript\nclass ApiError extends Error {\n  constructor(code, message, status = 500, details = null) {\n    super(message);\n    this.code = code;\n    this.status = status;\n    this.details = details;\n  }\n\n  static badRequest(message, details) {\n    return new ApiError('BAD_REQUEST', message, 400, details);\n  }\n\n  static notFound(resource) {\n    return new ApiError('NOT_FOUND', `${resource} not found`, 404);\n  }\n\n  static unauthorized() {\n    return new ApiError('UNAUTHORIZED', 'Authentication required', 401);\n  }\n}\n\n\u002F\u002F Global error handler\napp.use((err, req, res, next) => {\n  const status = err.status || 500;\n  const response = {\n    error: {\n      code: err.code || 'INTERNAL_ERROR',\n      message: status === 500 ? 'Internal server error' : err.message,\n      status,\n      requestId: req.id\n    }\n  };\n\n  if (err.details) response.error.details = err.details;\n  if (status >= 500) logger.error(err);\n\n  res.status(status).json(response);\n});\n```\n\n## Circuit Breaker Pattern\n\n```javascript\nclass CircuitBreaker {\n  constructor(threshold = 5, timeout = 30000) {\n    this.failures = 0;\n    this.threshold = threshold;\n    this.timeout = timeout;\n    this.state = 'CLOSED';\n  }\n\n  async call(fn) {\n    if (this.state === 'OPEN') throw new Error('Circuit open');\n    try {\n      const result = await fn();\n      this.failures = 0;\n      return result;\n    } catch (err) {\n      this.failures++;\n      if (this.failures >= this.threshold) {\n        this.state = 'OPEN';\n        setTimeout(() => this.state = 'HALF_OPEN', this.timeout);\n      }\n      throw err;\n    }\n  }\n}\n```\n\n## Additional Implementations\n\nSee [references\u002Fpython-flask.md](references\u002Fpython-flask.md) for:\n- Python Flask error handling with custom exceptions\n- Circuit breaker with automatic recovery\n- Retry with exponential backoff\n- Sentry integration\n\n## Best Practices\n\n- Use consistent error format across all endpoints\n- Include request IDs for traceability\n- Log errors at appropriate severity levels\n- Never expose stack traces to clients\n- Distinguish client errors (4xx) from server errors (5xx)\n- Provide actionable error messages\n","# API Error Handling\n\nImplement robust error handling with standardized responses and proper logging.\n\n## Standard Error Response Format\n\n```json\n{\n  \"error\": {\n    \"code\": \"VALIDATION_ERROR\",\n    \"message\": \"Invalid request parameters\",\n    \"status\": 400,\n    \"requestId\": \"req_abc123\",\n    \"timestamp\": \"2025-01-15T10:30:00Z\",\n    \"details\": [\n      { \"field\": \"email\", \"message\": \"Invalid email format\" }\n    ]\n  }\n}\n```\n\n## Error Class (Node.js)\n\n```javascript\nclass ApiError extends Error {\n  constructor(code, message, status = 500, details = null) {\n    super(message);\n    this.code = code;\n    this.status = status;\n    this.details = details;\n  }\n\n  static badRequest(message, details) {\n    return new ApiError('BAD_REQUEST', message, 400, details);\n  }\n\n  static notFound(resource) {\n    return new ApiError('NOT_FOUND', `${resource} not found`, 404);\n  }\n\n  static unauthorized() {\n    return new ApiError('UNAUTHORIZED', 'Authentication required', 401);\n  }\n}\n\n\u002F\u002F Global error handler\napp.use((err, req, res, next) => {\n  const status = err.status || 500;\n  const response = {\n    error: {\n      code: err.code || 'INTERNAL_ERROR',\n      message: status === 500 ? 'Internal server error' : err.message,\n      status,\n      requestId: req.id\n    }\n  };\n\n  if (err.details) response.error.details = err.details;\n  if (status >= 500) logger.error(err);\n\n  res.status(status).json(response);\n});\n```\n\n## Circuit Breaker Pattern\n\n```javascript\nclass CircuitBreaker {\n  constructor(threshold = 5, timeout = 30000) {\n    this.failures = 0;\n    this.threshold = threshold;\n    this.timeout = timeout;\n    this.state = 'CLOSED';\n  }\n\n  async call(fn) {\n    if (this.state === 'OPEN') throw new Error('Circuit open');\n    try {\n      const result = await fn();\n      this.failures = 0;\n      return result;\n    } catch (err) {\n      this.failures++;\n      if (this.failures >= this.threshold) {\n        this.state = 'OPEN';\n        setTimeout(() => this.state = 'HALF_OPEN', this.timeout);\n      }\n      throw err;\n    }\n  }\n}\n```\n\n## Additional Implementations\n\nSee [references\u002Fpython-flask.md](references\u002Fpython-flask.md) for:\n- Python Flask error handling with custom exceptions\n- Circuit breaker with automatic recovery\n- Retry with exponential backoff\n- Sentry integration\n\n## Best Practices\n\n- Use consistent error format across all endpoints\n- Include request IDs for traceability\n- Log errors at appropriate severity levels\n- Never expose stack traces to clients\n- Distinguish client errors (4xx) from server errors (5xx)\n- Provide actionable error messages\n",{"name":5,"license":15,"description":7},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002Fsecondsky\u002Fclaude-skills\u002Fapi-error-handling",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":8,"skillName":5,"commands":53,"prompt":63,"zipAvailable":64},[54,57,60],{"tool":55,"command":56},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill api-error-handling",{"tool":58,"command":59},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill api-error-handling",{"tool":61,"command":62},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill api-error-handling","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fsecondsky\u002Fclaude-skills\u002Fapi-error-handling\u002FSKILL.md",true,[66],{"path":67,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":70,"sourceHtmlUrl":71},"references\u002Fpython-flask.md","REFERENCE","参考文档",6866,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fsecondsky\u002Fclaude-skills\u002Fapi-error-handling\u002Freferences\u002Fpython-flask.md",[73,82,91,100,106,112],{"skillNo":74,"name":75,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":38},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[],[79,80,81],"model","model hierarchy","model hierarchy skill",{"skillNo":83,"name":84,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":38},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[],[88,89,90],"MCP","zoom","zoom mcp",{"skillNo":92,"name":93,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":38},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[97,98,99,89],"sdk","zoom apps sdk","apps",{"skillNo":101,"name":102,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":38},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[102],{"skillNo":107,"name":108,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":38},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[],[108],{"skillNo":113,"name":114,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":117,"publishedAt":38},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[114]]