[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M799X6M9S7T69SCY9KRB75Z1":3,"skill-same:01M799X6M9S7T69SCY9KRB75Z1":50},{"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":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":29,"install":30,"resources":43},"01M799X6M9S7T69SCY9KRB75Z1","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.","Elogic360\u002Fsoftware-factory","Elogic360","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F156535519?v=4","01M74NH3F0RB13PWB7JZDE2V80","elogic360","01M74NH3FPC65082MDZVMFHDM3",0,"MIT","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fapi-error-handling\u002Fskills\u002Fapi-error-handling\u002FSKILL.md",[],[],"2026-11-15 14:19:17",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","c475fc64e94e803b50d14a791dfee8853fbb2c5c","integrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fapi-error-handling\u002Fskills\u002Fapi-error-handling","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory","https:\u002F\u002Fgithub.com\u002FElogic360","2026-11-08 22:21:22",{"source":8,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add Elogic360\u002Fsoftware-factory --skill api-error-handling",{"tool":36,"command":37},"bunx","bunx skills add Elogic360\u002Fsoftware-factory --skill api-error-handling",{"tool":39,"command":40},"pnpm","pnpm dlx skills add Elogic360\u002Fsoftware-factory --skill api-error-handling","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fapi-error-handling\u002Fskills\u002Fapi-error-handling\u002FSKILL.md",true,[44],{"path":45,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":48,"sourceHtmlUrl":49},"references\u002Fpython-flask.md","REFERENCE","参考文档",6866,"https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fintegrations\u002Fclaude-skills-secondsky\u002Fplugins\u002Fapi-error-handling\u002Fskills\u002Fapi-error-handling\u002Freferences\u002Fpython-flask.md",[51,59,66,73,80,87],{"skillNo":52,"name":53,"nameZh":6,"description":54,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":55,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":19},"01M79G206MT3J6S0GY3C45P2KV","vss-summarize-video","Use to summarize a recorded video via the LVS summarization microservice (HITL-gated) with a VLM fallback. Not for report generation or live RTSP captioning.","Apache-2.0","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Fvss-summarize-video\u002FSKILL.md",[],[],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":55,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M79G1WN63PGRE8CKD47WEBQ5","vss-setup-video-analytics-api","Use to deploy the vss-video-analytics-api REST service standalone (config-source, data-log bind, Elasticsearch, optional Kafka). Not for full warehouse deploy.","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Fvss-setup-video-analytics-api\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":55,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M79G1S9F7VY3EF6H53PRP5AN","vss-setup-behavior-analytics","Use to deploy the vss-behavior-analytics service standalone (entrypoint, config-source, optional calibration). Not for the full warehouse deploy.","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Fvss-setup-behavior-analytics\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":55,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M79G1N1S1Y27PFZPYMNK1MTQ","vss-search-archive","Use this skill to run top-level VSS fusion search on archived video, or to ingest video files \u002F RTSP streams for search. Do NOT use for ad-hoc visual Q&A (use vss-ask-video), live captioning (use vss-deploy-dense-captioning), or video summarization and reports (use vss-summarize-video).","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Fvss-search-archive\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":55,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M79G1H6WN0Q6C0VCAXCZX6B7","vss-query-analytics","Use this skill when reading video-analytics metrics, incidents, alerts, and sensor data via the VA-MCP server (port 9901). Not for live VLM or incident-range narrative reports.","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Fvss-query-analytics\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":55,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M79G1DYPNXQS7QHZ0AAF5FX5","vss-manage-video-io-storage","Use to call the VIOS REST API (sensor list, timelines, clip extraction, snapshots, add\u002Fdelete sensors and streams). Not for VLM inference or search.","https:\u002F\u002Fgithub.com\u002FElogic360\u002Fsoftware-factory\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Fvss-manage-video-io-storage\u002FSKILL.md",[],[]]