[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71SPYNS9C15B3CWNXP8WVWW":3,"skill-same:01M71SPYNS9C15B3CWNXP8WVWW":95},{"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":23,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":45,"commitSha":46,"skillDirectory":47,"forksCount":48,"repositoryHtmlUrl":49,"repositoryHomepageUrl":50,"ownerHtmlUrl":51,"ownerBlogUrl":52,"ownerDescription":53,"updatedAt":54,"install":55,"resources":68},"01M71SPYNS9C15B3CWNXP8WVWW","error-handling-patterns",null,"Error handling patterns across languages — exceptions, Result types, propagation, graceful degradation","HigorAlves\u002Forc","HigorAlves","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F11262976?v=4","01M71S79EZEMHZ8PQSV0XQJHYY","Higor Alves","01M71S79FKKTCHCN1EDR8DSTWQ",7,"MIT","https:\u002F\u002Fgithub.com\u002FHigorAlves\u002Forc\u002Fblob\u002Fmain\u002Forc\u002Fskills\u002Ferror-handling-patterns\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"error","patterns","error handling","error handling patterns","reliability","types","implementing","when","across","designing apis","result","graceful degradation","use","propagation","degradation","2026-11-10 13:02:02",false,"---\nname: error-handling-patterns\ndescription: Error handling patterns across languages — exceptions, Result types, propagation, graceful degradation\nwhen_to_use: Use when implementing error handling, designing APIs, or improving reliability.\n---\n\n# Error Handling Patterns\n\nBuild resilient applications with robust error handling strategies that gracefully handle failures and provide excellent debugging experiences.\n\nThis SKILL.md is a thin index. **Read the relevant `references\u002F\u003Ctopic>.md` file** only when you need that topic's detail — the code samples and full patterns live there, not here.\n\n## When to Use This Skill\n\n- Implementing error handling in new features\n- Designing error-resilient APIs\n- Debugging production issues\n- Improving application reliability\n- Creating better error messages for users and developers\n- Implementing retry and circuit breaker patterns\n- Handling async\u002Fconcurrent errors\n- Building fault-tolerant distributed systems\n\n## Core Concepts\n\n**Error handling philosophies:**\n\n- **Exceptions** — traditional try-catch, disrupts control flow.\n- **Result types** — explicit success\u002Ffailure, functional approach.\n- **Error codes** — C-style, requires discipline.\n- **Option\u002FMaybe types** — for nullable values.\n\n**Error categories:**\n\n- **Recoverable** — network timeouts, missing files, invalid user input, API rate limits. Handle and continue (retry, fallback).\n- **Unrecoverable** — out of memory, stack overflow, programming bugs (null pointer). Fail loudly \u002F crash.\n\n## Decision Tree — which strategy?\n\n```\nIs the failure expected as part of normal operation\n(validation, parse, lookup miss, rate limit)?\n├── YES → Return a Result \u002F Option type.            → references\u002Fresult-types.md\n│         Caller must explicitly handle the failure.\n└── NO  → Is it a programming bug or truly unrecoverable\n          (OOM, invariant violation)?\n          ├── YES → Panic \u002F crash. Don't try to recover.\n          └── NO  → It's an unexpected-but-recoverable error\n                    → Throw an exception.               → references\u002Fexceptions.md\n\nThen, regardless of strategy:\n- Does the error cross layers \u002F async boundaries, or do you\n  need to collect several before surfacing?      → references\u002Fpropagation.md\n- Is this a flaky external \u002F distributed dependency you must\n  keep serving through (retry, circuit breaker, fallback)?\n                                                  → references\u002Fgraceful-degradation.md\n- Need the language-native idiom or full type defs?\n                                                  → references\u002Flanguage-specific.md\n- Unsure about messaging, logging, or cleanup hygiene?\n                                                  → references\u002Fbest-practices.md\n```\n\n## Topic Index\n\n| Topic | Read when you need… | Reference |\n|-------|--------------------|-----------|\n| Exceptions | Custom exception hierarchies, throwing, try-except\u002Fcatch structure, context-manager cleanup, the full comprehensive handler example | `references\u002Fexceptions.md` |\n| Result & Option types | Explicit `Result\u003CT, E>` \u002F `Option` values for expected errors and validation; helpers, chaining, consuming | `references\u002Fresult-types.md` |\n| Propagation | Re-throwing, wrapping\u002Fchaining for context (`%w`, `errors.Is`\u002F`As`, `?`), async\u002Fpromise propagation, error aggregation | `references\u002Fpropagation.md` |\n| Graceful degradation | Retry with backoff, circuit breaker, fallbacks\u002Fdegraded mode for recoverable & distributed failures | `references\u002Fgraceful-degradation.md` |\n| Language-specific | Per-language idioms and full type scaffolding (Python, TypeScript\u002FJavaScript, Rust, Go) | `references\u002Flanguage-specific.md` |\n| Best practices & pitfalls | Cross-cutting rules (fail fast, preserve context, log appropriately) and anti-patterns to avoid | `references\u002Fbest-practices.md` |\n","# Error Handling Patterns\n\nBuild resilient applications with robust error handling strategies that gracefully handle failures and provide excellent debugging experiences.\n\nThis SKILL.md is a thin index. **Read the relevant `references\u002F\u003Ctopic>.md` file** only when you need that topic's detail — the code samples and full patterns live there, not here.\n\n## When to Use This Skill\n\n- Implementing error handling in new features\n- Designing error-resilient APIs\n- Debugging production issues\n- Improving application reliability\n- Creating better error messages for users and developers\n- Implementing retry and circuit breaker patterns\n- Handling async\u002Fconcurrent errors\n- Building fault-tolerant distributed systems\n\n## Core Concepts\n\n**Error handling philosophies:**\n\n- **Exceptions** — traditional try-catch, disrupts control flow.\n- **Result types** — explicit success\u002Ffailure, functional approach.\n- **Error codes** — C-style, requires discipline.\n- **Option\u002FMaybe types** — for nullable values.\n\n**Error categories:**\n\n- **Recoverable** — network timeouts, missing files, invalid user input, API rate limits. Handle and continue (retry, fallback).\n- **Unrecoverable** — out of memory, stack overflow, programming bugs (null pointer). Fail loudly \u002F crash.\n\n## Decision Tree — which strategy?\n\n```\nIs the failure expected as part of normal operation\n(validation, parse, lookup miss, rate limit)?\n├── YES → Return a Result \u002F Option type.            → references\u002Fresult-types.md\n│         Caller must explicitly handle the failure.\n└── NO  → Is it a programming bug or truly unrecoverable\n          (OOM, invariant violation)?\n          ├── YES → Panic \u002F crash. Don't try to recover.\n          └── NO  → It's an unexpected-but-recoverable error\n                    → Throw an exception.               → references\u002Fexceptions.md\n\nThen, regardless of strategy:\n- Does the error cross layers \u002F async boundaries, or do you\n  need to collect several before surfacing?      → references\u002Fpropagation.md\n- Is this a flaky external \u002F distributed dependency you must\n  keep serving through (retry, circuit breaker, fallback)?\n                                                  → references\u002Fgraceful-degradation.md\n- Need the language-native idiom or full type defs?\n                                                  → references\u002Flanguage-specific.md\n- Unsure about messaging, logging, or cleanup hygiene?\n                                                  → references\u002Fbest-practices.md\n```\n\n## Topic Index\n\n| Topic | Read when you need… | Reference |\n|-------|--------------------|-----------|\n| Exceptions | Custom exception hierarchies, throwing, try-except\u002Fcatch structure, context-manager cleanup, the full comprehensive handler example | `references\u002Fexceptions.md` |\n| Result & Option types | Explicit `Result\u003CT, E>` \u002F `Option` values for expected errors and validation; helpers, chaining, consuming | `references\u002Fresult-types.md` |\n| Propagation | Re-throwing, wrapping\u002Fchaining for context (`%w`, `errors.Is`\u002F`As`, `?`), async\u002Fpromise propagation, error aggregation | `references\u002Fpropagation.md` |\n| Graceful degradation | Retry with backoff, circuit breaker, fallbacks\u002Fdegraded mode for recoverable & distributed failures | `references\u002Fgraceful-degradation.md` |\n| Language-specific | Per-language idioms and full type scaffolding (Python, TypeScript\u002FJavaScript, Rust, Go) | `references\u002Flanguage-specific.md` |\n| Best practices & pitfalls | Cross-cutting rules (fail fast, preserve context, log appropriately) and anti-patterns to avoid | `references\u002Fbest-practices.md` |\n",{"name":5,"description":7,"when_to_use":44},"Use when implementing error handling, designing APIs, or improving reliability.","main","7522fd7266944e30052204c2f6df287d8b5516be","orc\u002Fskills\u002Ferror-handling-patterns",0,"https:\u002F\u002Fgithub.com\u002FHigorAlves\u002Forc","https:\u002F\u002Forc.novacstack.com\u002F","https:\u002F\u002Fgithub.com\u002FHigorAlves","higoralves.dev","Software Engineering","2026-11-07 07:26:38",{"source":8,"skillName":5,"commands":56,"prompt":66,"zipAvailable":67},[57,60,63],{"tool":58,"command":59},"npx","npx skills add HigorAlves\u002Forc --skill error-handling-patterns",{"tool":61,"command":62},"bunx","bunx skills add HigorAlves\u002Forc --skill error-handling-patterns",{"tool":64,"command":65},"pnpm","pnpm dlx skills add HigorAlves\u002Forc --skill error-handling-patterns","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FHigorAlves\u002Forc\u002Fblob\u002Fmain\u002Forc\u002Fskills\u002Ferror-handling-patterns\u002FSKILL.md",true,[69,75,79,83,87,91],{"path":70,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":73,"sourceHtmlUrl":74},"references\u002Fbest-practices.md","REFERENCE","参考文档",1210,"https:\u002F\u002Fgithub.com\u002FHigorAlves\u002Forc\u002Fblob\u002Fmain\u002Forc\u002Fskills\u002Ferror-handling-patterns\u002Freferences\u002Fbest-practices.md",{"path":76,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":77,"sourceHtmlUrl":78},"references\u002Fexceptions.md",4246,"https:\u002F\u002Fgithub.com\u002FHigorAlves\u002Forc\u002Fblob\u002Fmain\u002Forc\u002Fskills\u002Ferror-handling-patterns\u002Freferences\u002Fexceptions.md",{"path":80,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":81,"sourceHtmlUrl":82},"references\u002Fgraceful-degradation.md",4779,"https:\u002F\u002Fgithub.com\u002FHigorAlves\u002Forc\u002Fblob\u002Fmain\u002Forc\u002Fskills\u002Ferror-handling-patterns\u002Freferences\u002Fgraceful-degradation.md",{"path":84,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":85,"sourceHtmlUrl":86},"references\u002Flanguage-specific.md",2299,"https:\u002F\u002Fgithub.com\u002FHigorAlves\u002Forc\u002Fblob\u002Fmain\u002Forc\u002Fskills\u002Ferror-handling-patterns\u002Freferences\u002Flanguage-specific.md",{"path":88,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":89,"sourceHtmlUrl":90},"references\u002Fpropagation.md",3458,"https:\u002F\u002Fgithub.com\u002FHigorAlves\u002Forc\u002Fblob\u002Fmain\u002Forc\u002Fskills\u002Ferror-handling-patterns\u002Freferences\u002Fpropagation.md",{"path":92,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":93,"sourceHtmlUrl":94},"references\u002Fresult-types.md",2064,"https:\u002F\u002Fgithub.com\u002FHigorAlves\u002Forc\u002Fblob\u002Fmain\u002Forc\u002Fskills\u002Ferror-handling-patterns\u002Freferences\u002Fresult-types.md",[96,132,156,177,199,219],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":113,"publishedAt":39},"01M71SW40F9TAAEDKBYYBCM814","writing-plans","Write a comprehensive implementation plan of bite-sized TDD tasks that an engineer with zero codebase context could execute — exact files, code, tests, and verification steps","https:\u002F\u002Fgithub.com\u002FHigorAlves\u002Forc\u002Fblob\u002Fmain\u002Forc\u002Fskills\u002Fwriting-plans\u002FSKILL.md",[102,105,110],{"categoryNo":103,"categoryName":104,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000018","写作与文案",{"categoryNo":106,"categoryName":107,"taxonomyType":108,"taxonomyTypeDesc":109},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",{"categoryNo":111,"categoryName":112,"taxonomyType":108,"taxonomyTypeDesc":109},"01JBSEEDCAT000000000000036","内容创作者",[114,115,116,117,118,119,120,31,121,122,123,124,125,126,127,128,129,130,131,36],"writing","writing plans","plans","engineer","superpowers","implementation plan","files","you","code","tasks","verification","plan","write","steps","context","ZeRO","for","tests",{"skillNo":133,"name":134,"nameZh":6,"description":135,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":136,"categories":137,"keywords":141,"publishedAt":39},"01M71SW15KHE4MHJW9NEXV65X2","writing-for-agents","orc's doctrine layer for writing any document an agent consumes — skills, AGENTS.md\u002FCLAUDE.md, reference docs","https:\u002F\u002Fgithub.com\u002FHigorAlves\u002Forc\u002Fblob\u002Fmain\u002Forc\u002Fskills\u002Fwriting-for-agents\u002FSKILL.md",[138,139,140],{"categoryNo":103,"categoryName":104,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":111,"categoryName":112,"taxonomyType":108,"taxonomyTypeDesc":109},[142,114,130,143,31,144,145,146,147,148,149,150,36,151,152,153,154,155],"writing for agents","matt pocock","inline","tuning","a skill","layer","doctrine","push","editing","document","github","https","reference","docs",{"skillNo":157,"name":158,"nameZh":6,"description":159,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":160,"categories":161,"keywords":163,"publishedAt":39},"01M71SVYQKXT743HHHWGHT3G13","workspace-mode","Use when cwd is a parent dir holding multiple sibling git repos — defines repo auto-detection, --repos\u002F--repo\u002F--all-repos\u002F--this-repo precedence, per-repo dispatch, and linked-PR mechanics.","https:\u002F\u002Fgithub.com\u002FHigorAlves\u002Forc\u002Fblob\u002Fmain\u002Forc\u002Fskills\u002Fworkspace-mode\u002FSKILL.md",[162],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[164,165,166,167,168,31,169,170,171,172,36,173,174,175,176],"workspace mode","mode","workspace","mechanics","auto","repos","git","pr","repo","dispatch","auto-detection","detection","parent",{"skillNo":178,"name":179,"nameZh":6,"description":180,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":181,"categories":182,"keywords":184,"publishedAt":39},"01M71SVVP3BXS06G9395P2K0RH","wizard","Generate an interactive bash wizard walking a human through work only they can perform — credentials, secrets, one-off migrations","https:\u002F\u002Fgithub.com\u002FHigorAlves\u002Forc\u002Fblob\u002Fmain\u002Forc\u002Fskills\u002Fwizard\u002FSKILL.md",[183],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[179,185,186,187,188,143,31,189,190,191,192,193,194,127,195,196,130,36,197,198],"condition","never","provisioning infrastructure","only","Bash","work","credentials","generate","human","secrets","infrastructure","do","one","interactive",{"skillNo":200,"name":201,"nameZh":6,"description":202,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":203,"categories":204,"keywords":205,"publishedAt":39},"01M71SVT4AR6NKAM5B077E7QSJ","wait-what","Stop and re-pitch — the last message did not land; say it again simply, in the project's own vocabulary.","https:\u002F\u002Fgithub.com\u002FHigorAlves\u002Forc\u002Fblob\u002Fmain\u002Forc\u002Fskills\u002Fwait-what\u002FSKILL.md",[],[206,207,208,209,210,143,211,212,213,214,152,153,215,216,217,218],"wait what","wait","project","re","true","pitch","last","say","message","land","it","stop","vocabulary",{"skillNo":220,"name":221,"nameZh":6,"description":222,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":223,"categories":224,"keywords":229,"publishedAt":39},"01M71SVQVYRA9QBQ6G8MWR8G6F","vitest","Vitest fast unit testing framework powered by Vite with Jest-compatible API","https:\u002F\u002Fgithub.com\u002FHigorAlves\u002Forc\u002Fblob\u002Fmain\u002Forc\u002Fskills\u002Fvitest\u002FSKILL.md",[225,228],{"categoryNo":226,"categoryName":227,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量",{"categoryNo":106,"categoryName":107,"taxonomyType":108,"taxonomyTypeDesc":109},[221,230,231,232,233,234,114,31,235,236,237,238,239,240,241,242,243,244,131,245],"coverage","unit","testing","testing framework","generated","api","jest","2026","at","scripts","unit testing","antfu","framework","vite","mocking","dev"]