[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EBJZ4QWJD026SSQBHHS2WH":3,"skill-same:01M6EBJZ4QWJD026SSQBHHS2WH":66},{"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":29,"linkOnly":30,"markdownContent":31,"markdownBody":32,"frontMatter":33,"refName":26,"commitSha":34,"skillDirectory":35,"forksCount":36,"repositoryHtmlUrl":37,"repositoryHomepageUrl":38,"ownerHtmlUrl":39,"ownerBlogUrl":6,"ownerDescription":40,"updatedAt":41,"install":42,"resources":55},"01M6EBJZ4QWJD026SSQBHHS2WH","nestjs-error-handling",null,"Global Exception Filters and standard error formats. Use when implementing global exception filters or standardizing error responses in NestJS. (triggers: **\u002F*.filter.ts, main.ts, ExceptionFilter, Catch, HttpException)","ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",66,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FHoangNguyen0403\u002Fagent-skills-standard\u002Fnestjs-error-handling\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28],"error handling","nestjs","error","nestjs error handling","global","use","filters","main","triggers","filter","2026-11-10 10:12:30",false,"---\nname: nestjs-error-handling\ndescription: \"Global Exception Filters and standard error formats. Use when implementing global exception filters or standardizing error responses in NestJS. (triggers: **\u002F*.filter.ts, main.ts, ExceptionFilter, Catch, HttpException)\"\n---\n\n# NestJS Error Handling Standards\n\n## **Priority: P1 (OPERATIONAL)**\n\nGlobal error handling and exception management patterns.\n\n- **Requirement**: Centralize error formatting.\n- **Platform Agnostic**: Do **not** import `Request`\u002F`Response` from Express\u002FFastify types directly.\n  - **Use**: `HttpAdapterHost` to access the underlying platform response methods.\n  - `const { httpAdapter } = this.httpAdapterHost;`\n- **Structure**:\n  - Implement strictly typed error responses.\n  - Refer to **[API Standards](..\u002Fnestjs-api-standards\u002FSKILL.md)** for `ApiErrorResponse`.\n\n  ```json\n  {\n    \"statusCode\": 400,\n    \"message\": \"Validation failed\",\n    \"error\": \"Bad Request\",\n    \"timestamp\": \"ISO...\",\n    \"path\": \"\u002Fusers\"\n  }\n  ```\n\n## Error Flow\n\n1. **Service**: Throws specific or generic errors (e.g., `EntityNotFoundError`).\n2. **Interceptor**: Maps low-level errors to HTTP Exceptions (e.g., `catchError(err => throw new NotFoundException())`).\n   - _Why_: Keeps Exception Filters focused on formatting, not business logic interpretation.\n3. **Global Filter**: Formats the final JSON response.\n\n## Built-in Exceptions\n\n- **Use**: Throw `NotFoundException`, `ForbiddenException`, `BadRequestException`.\n- **Custom**: Extend `HttpException` only for domain-specific failures that need specific status codes.\n\n## Logging\n\n- **Context**: Always pass `MyClass.name` to the `Logger` constructor.\n- **Levels**:\n  - `error`: 500s (Stack trace required).\n  - `warn`: 400s (Client errors).\n\n## Security (Information Leakage)\n\n- **Production**: **NEVER** expose stack traces in HTTP responses (`process.env.NODE_ENV === 'production'`).\n- **Sanitization**: Ensure `ApiException` payloads do not leak internal file paths or raw variable dumps.\n\n\n## Anti-Patterns\n\n- **No stack traces in production**: Gate stack exposure behind `NODE_ENV === 'production'` check.\n- **No Express types in filters**: Use `HttpAdapterHost` for platform-agnostic error handling.\n- **No HttpException in services**: Throw domain errors in services; let Interceptors map to HTTP exceptions.\n\n","# NestJS Error Handling Standards\n\n## **Priority: P1 (OPERATIONAL)**\n\nGlobal error handling and exception management patterns.\n\n- **Requirement**: Centralize error formatting.\n- **Platform Agnostic**: Do **not** import `Request`\u002F`Response` from Express\u002FFastify types directly.\n  - **Use**: `HttpAdapterHost` to access the underlying platform response methods.\n  - `const { httpAdapter } = this.httpAdapterHost;`\n- **Structure**:\n  - Implement strictly typed error responses.\n  - Refer to **[API Standards](..\u002Fnestjs-api-standards\u002FSKILL.md)** for `ApiErrorResponse`.\n\n  ```json\n  {\n    \"statusCode\": 400,\n    \"message\": \"Validation failed\",\n    \"error\": \"Bad Request\",\n    \"timestamp\": \"ISO...\",\n    \"path\": \"\u002Fusers\"\n  }\n  ```\n\n## Error Flow\n\n1. **Service**: Throws specific or generic errors (e.g., `EntityNotFoundError`).\n2. **Interceptor**: Maps low-level errors to HTTP Exceptions (e.g., `catchError(err => throw new NotFoundException())`).\n   - _Why_: Keeps Exception Filters focused on formatting, not business logic interpretation.\n3. **Global Filter**: Formats the final JSON response.\n\n## Built-in Exceptions\n\n- **Use**: Throw `NotFoundException`, `ForbiddenException`, `BadRequestException`.\n- **Custom**: Extend `HttpException` only for domain-specific failures that need specific status codes.\n\n## Logging\n\n- **Context**: Always pass `MyClass.name` to the `Logger` constructor.\n- **Levels**:\n  - `error`: 500s (Stack trace required).\n  - `warn`: 400s (Client errors).\n\n## Security (Information Leakage)\n\n- **Production**: **NEVER** expose stack traces in HTTP responses (`process.env.NODE_ENV === 'production'`).\n- **Sanitization**: Ensure `ApiException` payloads do not leak internal file paths or raw variable dumps.\n\n\n## Anti-Patterns\n\n- **No stack traces in production**: Gate stack exposure behind `NODE_ENV === 'production'` check.\n- **No Express types in filters**: Use `HttpAdapterHost` for platform-agnostic error handling.\n- **No HttpException in services**: Throw domain errors in services; let Interceptors map to HTTP exceptions.\n\n",{"name":5,"description":7},"def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002FHoangNguyen0403\u002Fagent-skills-standard\u002Fnestjs-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":43,"prompt":53,"zipAvailable":54},[44,47,50],{"tool":45,"command":46},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill nestjs-error-handling",{"tool":48,"command":49},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill nestjs-error-handling",{"tool":51,"command":52},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill nestjs-error-handling","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FHoangNguyen0403\u002Fagent-skills-standard\u002Fnestjs-error-handling\u002FSKILL.md",true,[56,62],{"path":57,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":60,"sourceHtmlUrl":61},"references\u002Fax-profiles.md","REFERENCE","参考文档",4605,"https:\u002F\u002Fgithub.com\u002FThamielis\u002F.agents\u002Fblob\u002Fmain\u002Fplugins\u002Farize-ax\u002Fskills\u002Farize-experiment\u002Freferences\u002Fax-profiles.md",{"path":63,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":64,"sourceHtmlUrl":65},"references\u002Fax-setup.md",1529,"https:\u002F\u002Fgithub.com\u002FThamielis\u002F.agents\u002Fblob\u002Fmain\u002Fplugins\u002Farize-ax\u002Fskills\u002Farize-experiment\u002Freferences\u002Fax-setup.md",[67,81,91,100,106,113],{"skillNo":68,"name":69,"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":70,"categories":71,"keywords":77,"publishedAt":29},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[72],{"categoryNo":73,"categoryName":74,"taxonomyType":75,"taxonomyTypeDesc":76},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[78,79,80],"model","model hierarchy","model hierarchy skill",{"skillNo":82,"name":83,"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":84,"categories":85,"keywords":87,"publishedAt":29},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[86],{"categoryNo":73,"categoryName":74,"taxonomyType":75,"taxonomyTypeDesc":76},[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":29},"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":29},"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":112,"publishedAt":29},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[111],{"categoryNo":73,"categoryName":74,"taxonomyType":75,"taxonomyTypeDesc":76},[108],{"skillNo":114,"name":115,"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":116,"categories":117,"keywords":118,"publishedAt":29},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[115]]