web-error-handling-result-types

Installation
SKILL.md

TypeScript Result Type Patterns

Quick Guide: A Result<T, E> is a discriminated union on ok, so TypeScript refuses to read value until 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.mdPromise<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

Which path applies

Installs
61
GitHub Stars
24
First Seen
Mar 19, 2026
web-error-handling-result-types — agents-inc/skills