What problem does it solve?
Effect programs frequently fail in ways that are either too vague (defects) or too messy (untyped error handling), making recovery inconsistent and unsafe across layers; this skill helps you design and implement typed, tag-based error channels in Effect v4 so callers can reliably match and recover.
Core Features & Use Cases
- Typed error classes with schemas: Build domain errors using Schema.TaggedErrorClass so errors carry an explicit _tag and validated payload.
- Correct v4 catching primitives: Use Effect.catchTag/catchTags, Effect.catchReason/catchReasons, Effect.unwrapReason, Effect.catchFilter, and Cause inspectors to handle failures precisely.
- Defects vs error channel boundaries: Distinguish expected business failures (error channel) from programming errors (defects) and place conversions at adapter boundaries.
- Cause model that matches v4 reality: Treat Cause as a flat array of reasons and use Cause.hasFails/hasDies/hasInterrupts and Cause.findErrorOption/findDefect/findInterrupt.
- Exhaustive matching patterns: Prefer structured error handling with Match-ready patterns to avoid missing error variants.
Quick Start
Tell the AI: "Show me how to define a Schema.TaggedErrorClass for a tagged API failure, then update my Effect.gen code to catch only that tag and recover with a sensible fallback using the correct Effect v4 combinators."