[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EB8TNJMSNV00AZPKBJY9A7":3,"skill-same:01M6EB8TNJMSNV00AZPKBJY9A7":121},{"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":36,"linkOnly":37,"markdownContent":38,"markdownBody":39,"frontMatter":40,"refName":62,"commitSha":63,"skillDirectory":64,"forksCount":65,"repositoryHtmlUrl":66,"repositoryHomepageUrl":67,"ownerHtmlUrl":68,"ownerBlogUrl":6,"ownerDescription":69,"updatedAt":70,"install":71,"resources":84},"01M6EB8TNJMSNV00AZPKBJY9A7","Common Error Handling",null,"Cross-cutting standards for error design, response shapes, error codes, and boundary placement. Use when handling errors, designing exception flows, or standardizing error responses.","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\u002FHoangNguyen0403\u002Fagent-skills-standard\u002Ferror-handling\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35],"common error handling","error","error handling","common","api","codes","service","error-handling","standards","use","design","boundary","controller","java","code","resilience","go","2026-11-10 10:12:30",false,"---\nname: Common Error Handling\ndescription: Cross-cutting standards for error design, response shapes, error codes, and boundary placement. Use when handling errors, designing exception flows, or standardizing error responses.\nmetadata:\n  labels: [error-handling, exceptions, resilience, api-errors]\n  triggers:\n    files:\n      [\n        '**\u002F*.service.ts',\n        '**\u002F*.handler.ts',\n        '**\u002F*.controller.ts',\n        '**\u002F*.go',\n        '**\u002F*.java',\n        '**\u002F*.kt',\n        '**\u002F*.py',\n      ]\n    keywords:\n      [\n        'error handling',\n        exception,\n        'try catch',\n        'error boundary',\n        'error response',\n        'error code',\n        throw,\n        Result,\n      ]\n---\n\n# Common Error Handling Standards\n\n## **Priority: P1 (OPERATIONAL)**\n\nConsistent, predictable error handling is the backbone of maintainable systems. Errors are first-class citizens — design them explicitly.\n\n## ? Error Response Shape (HTTP APIs)\n\nAll API errors MUST use a consistent envelope:\n\n```json\n{\n  \"error\": {\n    \"code\": \"USER_NOT_FOUND\",\n    \"message\": \"The requested user does not exist.\",\n    \"traceId\": \"4bf92f3577b34da6a3ce929d0e0e4736\",\n    \"details\": []\n  }\n}\n```\n\n| Field     | Rule                                                                              |\n| --------- | --------------------------------------------------------------------------------- |\n| `code`    | SCREAMING_SNAKE_CASE machine-readable code. Never localize.                       |\n| `message` | Human-readable English summary. Safe for end-users (no stack traces).             |\n| `traceId` | Correlation ID from the request context.                                          |\n| `details` | Optional array of field-level validation errors. Empty for non-validation errors. |\n\n## ? Error Classification\n\n| Layer          | Error Type                  | Strategy                                 |\n| -------------- | --------------------------- | ---------------------------------------- |\n| Validation     | `400 Bad Request`           | Return `details[]` with field paths      |\n| Authentication | `401 Unauthorized`          | Generic message — never expose reason    |\n| Authorization  | `403 Forbidden`             | Log attempt, never expose role info      |\n| Not Found      | `404 Not Found`             | Distinguishable from auth errors         |\n| Conflict       | `409 Conflict`              | Include conflicting resource ID          |\n| Unhandled      | `500 Internal Server Error` | Log full context, return generic message |\n\n## ? Error Wrapping vs Replacement\n\n- **Wrap** when adding context: `fmt.Errorf(\"processOrder: %w\", err)` (Go) \u002F `new ServiceError('msg', { cause: err })` (JS).\n- **Replace** only when the original error leaks sensitive internal details.\n- **Never swallow**: Catch without logging or re-throwing hides bugs — forbidden.\n\n## ? Boundary Placement\n\n- **API Layer**: Translate domain\u002Finfrastructure errors into HTTP responses. Use a global exception filter\u002Fmiddleware.\n- **Domain Layer**: Throw domain-specific errors (e.g., `InsufficientStockError`). Never reference HTTP status codes.\n- **Infrastructure Layer**: Throw infrastructure errors (e.g., `DatabaseConnectionError`). Wrap 3rd party exceptions.\n- **Never**: Let infrastructure errors (raw DB\u002Fnetwork exceptions) bubble up to the API response.\n\n```\nRequest → [API Layer: maps to HTTP] → [Domain: business errors] → [Infra: DB\u002Fnetwork errors]\n```\n\n## ? Error Code Design\n\n- Codes are **permanent IDs** — treat them like API contracts. Once published, never rename.\n- Format: `\u003CDOMAIN>_\u003CNOUN>_\u003CVERB>` → `ORDER_PAYMENT_FAILED`, `USER_EMAIL_DUPLICATE`.\n- Define in a centralized constants file; never inline magic strings.\n\n## Anti-Patterns\n\n- **No `catch(e) {}`**: Always log or re-throw.\n- **No stack traces in responses**: Leak internal structure to attackers.\n- **No generic `500` for validation**: Use `400` with `details`.\n- **No HTTP status codes in domain layer**: Domain errors are business concepts, not transport decisions.\n- **No error-code proliferation**: Prefer a small, well-documented set over one code per exception class.\n\n","# Common Error Handling Standards\n\n## **Priority: P1 (OPERATIONAL)**\n\nConsistent, predictable error handling is the backbone of maintainable systems. Errors are first-class citizens — design them explicitly.\n\n## ? Error Response Shape (HTTP APIs)\n\nAll API errors MUST use a consistent envelope:\n\n```json\n{\n  \"error\": {\n    \"code\": \"USER_NOT_FOUND\",\n    \"message\": \"The requested user does not exist.\",\n    \"traceId\": \"4bf92f3577b34da6a3ce929d0e0e4736\",\n    \"details\": []\n  }\n}\n```\n\n| Field     | Rule                                                                              |\n| --------- | --------------------------------------------------------------------------------- |\n| `code`    | SCREAMING_SNAKE_CASE machine-readable code. Never localize.                       |\n| `message` | Human-readable English summary. Safe for end-users (no stack traces).             |\n| `traceId` | Correlation ID from the request context.                                          |\n| `details` | Optional array of field-level validation errors. Empty for non-validation errors. |\n\n## ? Error Classification\n\n| Layer          | Error Type                  | Strategy                                 |\n| -------------- | --------------------------- | ---------------------------------------- |\n| Validation     | `400 Bad Request`           | Return `details[]` with field paths      |\n| Authentication | `401 Unauthorized`          | Generic message — never expose reason    |\n| Authorization  | `403 Forbidden`             | Log attempt, never expose role info      |\n| Not Found      | `404 Not Found`             | Distinguishable from auth errors         |\n| Conflict       | `409 Conflict`              | Include conflicting resource ID          |\n| Unhandled      | `500 Internal Server Error` | Log full context, return generic message |\n\n## ? Error Wrapping vs Replacement\n\n- **Wrap** when adding context: `fmt.Errorf(\"processOrder: %w\", err)` (Go) \u002F `new ServiceError('msg', { cause: err })` (JS).\n- **Replace** only when the original error leaks sensitive internal details.\n- **Never swallow**: Catch without logging or re-throwing hides bugs — forbidden.\n\n## ? Boundary Placement\n\n- **API Layer**: Translate domain\u002Finfrastructure errors into HTTP responses. Use a global exception filter\u002Fmiddleware.\n- **Domain Layer**: Throw domain-specific errors (e.g., `InsufficientStockError`). Never reference HTTP status codes.\n- **Infrastructure Layer**: Throw infrastructure errors (e.g., `DatabaseConnectionError`). Wrap 3rd party exceptions.\n- **Never**: Let infrastructure errors (raw DB\u002Fnetwork exceptions) bubble up to the API response.\n\n```\nRequest → [API Layer: maps to HTTP] → [Domain: business errors] → [Infra: DB\u002Fnetwork errors]\n```\n\n## ? Error Code Design\n\n- Codes are **permanent IDs** — treat them like API contracts. Once published, never rename.\n- Format: `\u003CDOMAIN>_\u003CNOUN>_\u003CVERB>` → `ORDER_PAYMENT_FAILED`, `USER_EMAIL_DUPLICATE`.\n- Define in a centralized constants file; never inline magic strings.\n\n## Anti-Patterns\n\n- **No `catch(e) {}`**: Always log or re-throw.\n- **No stack traces in responses**: Leak internal structure to attackers.\n- **No generic `500` for validation**: Use `400` with `details`.\n- **No HTTP status codes in domain layer**: Domain errors are business concepts, not transport decisions.\n- **No error-code proliferation**: Prefer a small, well-documented set over one code per exception class.\n\n",{"name":5,"metadata":41,"description":7},{"labels":42,"triggers":45},[26,43,34,44],"exceptions","api-errors",{"files":46,"keywords":54},[47,48,49,50,51,52,53],"**\u002F*.service.ts","**\u002F*.handler.ts","**\u002F*.controller.ts","**\u002F*.go","**\u002F*.java","**\u002F*.kt","**\u002F*.py",[21,55,56,57,58,59,60,61],"exception","try catch","error boundary","error response","error code","throw","Result","main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002FHoangNguyen0403\u002Fagent-skills-standard\u002Ferror-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":72,"prompt":82,"zipAvailable":83},[73,76,79],{"tool":74,"command":75},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill \"Common Error Handling\"",{"tool":77,"command":78},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill \"Common Error Handling\"",{"tool":80,"command":81},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill \"Common Error Handling\"","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FHoangNguyen0403\u002Fagent-skills-standard\u002Ferror-handling\u002FSKILL.md",true,[85,91,95,101,105,109,113,117],{"path":86,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":89,"sourceHtmlUrl":90},"agents\u002Fartifact-analyzer.md","REFERENCE","参考文档",2646,"https:\u002F\u002Fgithub.com\u002FdevelopAgent\u002Fbmad-start\u002Fblob\u002Fmain\u002F.iflow\u002Fskills\u002Fbmad-prfaq\u002Fagents\u002Fartifact-analyzer.md",{"path":92,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":93,"sourceHtmlUrl":94},"agents\u002Fweb-researcher.md",1756,"https:\u002F\u002Fgithub.com\u002FdevelopAgent\u002Fbmad-start\u002Fblob\u002Fmain\u002F.iflow\u002Fskills\u002Fbmad-prfaq\u002Fagents\u002Fweb-researcher.md",{"path":96,"resourceType":97,"resourceTypeDesc":98,"sizeBytes":99,"sourceHtmlUrl":100},"assets\u002Fprfaq-template.md","ASSET","资产文件",1434,"https:\u002F\u002Fgithub.com\u002FdevelopAgent\u002Fbmad-start\u002Fblob\u002Fmain\u002F.iflow\u002Fskills\u002Fbmad-prfaq\u002Fassets\u002Fprfaq-template.md",{"path":102,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":103,"sourceHtmlUrl":104},"bmad-manifest.json",458,"https:\u002F\u002Fgithub.com\u002FdevelopAgent\u002Fbmad-start\u002Fblob\u002Fmain\u002F.iflow\u002Fskills\u002Fbmad-prfaq\u002Fbmad-manifest.json",{"path":106,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":107,"sourceHtmlUrl":108},"references\u002Fcustomer-faq.md",3697,"https:\u002F\u002Fgithub.com\u002FdevelopAgent\u002Fbmad-start\u002Fblob\u002Fmain\u002F.iflow\u002Fskills\u002Fbmad-prfaq\u002Freferences\u002Fcustomer-faq.md",{"path":110,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":111,"sourceHtmlUrl":112},"references\u002Finternal-faq.md",3928,"https:\u002F\u002Fgithub.com\u002FdevelopAgent\u002Fbmad-start\u002Fblob\u002Fmain\u002F.iflow\u002Fskills\u002Fbmad-prfaq\u002Freferences\u002Finternal-faq.md",{"path":114,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":115,"sourceHtmlUrl":116},"references\u002Fpress-release.md",4308,"https:\u002F\u002Fgithub.com\u002FdevelopAgent\u002Fbmad-start\u002Fblob\u002Fmain\u002F.iflow\u002Fskills\u002Fbmad-prfaq\u002Freferences\u002Fpress-release.md",{"path":118,"resourceType":87,"resourceTypeDesc":88,"sizeBytes":119,"sourceHtmlUrl":120},"references\u002Fverdict.md",4262,"https:\u002F\u002Fgithub.com\u002FdevelopAgent\u002Fbmad-start\u002Fblob\u002Fmain\u002F.iflow\u002Fskills\u002Fbmad-prfaq\u002Freferences\u002Fverdict.md",[122,131,140,149,155,161],{"skillNo":123,"name":124,"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":125,"categories":126,"keywords":127,"publishedAt":36},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[],[128,129,130],"model","model hierarchy","model hierarchy skill",{"skillNo":132,"name":133,"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":134,"categories":135,"keywords":136,"publishedAt":36},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[],[137,138,139],"MCP","zoom","zoom mcp",{"skillNo":141,"name":142,"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":143,"categories":144,"keywords":145,"publishedAt":36},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[146,147,148,138],"sdk","zoom apps sdk","apps",{"skillNo":150,"name":151,"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":152,"categories":153,"keywords":154,"publishedAt":36},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[151],{"skillNo":156,"name":157,"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":158,"categories":159,"keywords":160,"publishedAt":36},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[],[157],{"skillNo":162,"name":163,"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":164,"categories":165,"keywords":166,"publishedAt":36},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[163]]