web-error-handling-result-types
Installation
SKILL.md
TypeScript Result Type Patterns
Quick Guide: A
Result<T, E>is a discriminated union onok, so TypeScript refuses to readvalueuntil the caller has checked. That moves a function's failure modes into its signature, where an exception hides them. Use it for expected failures — validation, parsing, requests — and keep exceptions for bugs and for conditions nothing downstream can act on. A custom implementation is about forty lines and the recommended default; the whole surface is in this skill.
Detailed Resources:
- examples/core.md — the Result module, typed error definitions, wrapping throwing code, pattern matching
- examples/async.md —
Promise<Result>, async chaining, retry, converting a promise - examples/combining.md — fail-fast, collect-all, object and sequential combination
- reference.md — operation lookup, what Results do not catch, error-type templates