effect-patterns-error-handling

Implement tagged-error recovery with mapError, catchTag, catchAll, and retry in Effect-TS applications.

785|26|Updated Jun 22, 2025
One-click install
npx skills add https://github.com/PaulJPhilp/EffectPatterns --skill effect-patterns-error-handling
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: effect-patterns-error-handling
Source: https://github.com/PaulJPhilp/EffectPatterns/tree/main/config/.claude-plugin/plugins/effect-patterns/skills/effect-patterns-error-handling
Command: npx skills add https://github.com/PaulJPhilp/EffectPatterns --skill effect-patterns-error-handling

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill addresses the challenge of implementing robust, domain-aware error handling in Effect-TS applications, enabling precise recovery strategies and clear error context.

Core Features & Use Cases

  • Domain-aware error types with tagged errors
  • Per-error recovery strategies and context-rich error propagation
  • Patterns for propagation, retry, and user-friendly fallbacks across network, validation, and business logic

Quick Start

  • Define custom error classes (e.g., NetworkError, ValidationError) and decide recovery strategy for each
  • Use Effect.mapError, Effect.catchTag, and Effect.catchAll to transform and recover
  • Apply retry/backoff and fallback strategies in end-to-end flows

Frequently Asked Questions about effect-patterns-error-handling

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

FAQPage Schema
How do I handle different error types in Effect-TS functional programming?

Handle different error types in Effect-TS by defining custom tagged errors like NetworkError or ValidationError, then use Effect.mapError and Effect.catchTag to apply specific recovery strategies per error class.

What is the best way to implement retry patterns for domain errors in Effect-TS?

Implement retry patterns in Effect-TS by combining tagged domain errors with retry and backoff strategies, ensuring precise recovery and clear error context across business-logic flows and network calls.

How does catchTag work for error handling in TypeScript functional programming?

catchTag works in TypeScript functional programming by intercepting specific tagged errors within an Effect workflow, allowing you to transform or recover from distinct domain errors while letting other failures propagate.

Can I use Effect-TS error handling for data validation and network calls?

Yes, you can use Effect-TS error handling for data validation and network calls by defining distinct tagged error classes and applying mapError to provide context-rich error propagation across different application layers.

When should I use catchAll instead of catchTag for TypeScript error handling?

Use catchAll for TypeScript error handling when you need a single recovery strategy for all remaining failures, whereas catchTag targets specific tagged domain errors for precise per-error recovery logic.

Why are tagged errors needed for domain-aware error handling in Effect-TS?

Tagged errors are needed for domain-aware error handling in Effect-TS because they enable the type system to distinguish between different failure types, allowing precise recovery strategies and clear error context across application layers.