error-handling

Handle typed errors in Effect with Data.TaggedError and catchTag.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/front-depiction/claude-setup --skill error-handling-front-depiction
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: error-handling
Source: https://github.com/front-depiction/claude-setup/tree/main/skills/error-handling
Command: npx skills add https://github.com/front-depiction/claude-setup --skill error-handling-front-depiction

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill teaches you to model and handle failures in Effect using typed error channels, Data.TaggedError, and structured recovery patterns.

Core Features & Use Cases

  • Typed errors: Use Data.TaggedError to define domain errors that travel in the error channel.
  • Pattern matching: Use catchTag, catchTags, and catchAll to handle errors in a principled, exhaustible way.
  • Recovery & boundaries: Compose error transformations (mapError) and boundary handling at application layers.

Quick Start

Apply typed error handling in an Effect-based TypeScript project by introducing Data.TaggedError types and using catchTag/catchTags to handle errors.

Frequently Asked Questions about error-handling

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle typed errors in Effect using TypeScript?

Typed errors in Effect are modeled using Data.TaggedError to define domain failures that travel in the error channel. You handle these errors using catchTag, catchTags, and catchAll for principled, exhaustible pattern matching.

What is the difference between error-channel and defect semantics in Effect?

Error-channel failures in Effect are expected, typed domain errors caught via catchTag or catchAll, whereas defects are unexpected failures outside the error channel. mapError transforms error-channel types, leaving defects isolated.

How do I use catchTag and catchTags for pattern matching errors in Effect?

Use catchTag to intercept and handle a specific tagged error from an Effect's error channel, and use catchTags to handle multiple tagged errors simultaneously, ensuring exhaustible recovery across domain failures.

Can I use mapError to transform error channel types in Effect?

Yes, mapError transforms the error channel type in Effect. It is applied to compose error transformations and establish clear error boundaries across different application layers.

Does this typed error handling approach work with functional TypeScript applications?

Yes, this approach is designed for functional TypeScript applications using Effect. It enables robust error handling, structured recovery, and clear error boundary semantics without relying on traditional try/catch blocks.