How to write generic reusable Effect.catchTag handlers for TaggedErrors
Problem:
I have repetitive
What I’d like:
Define typed, reusable error handlers once, then compose them easily in
I want to avoid repeating full generic signatures for
Current code structure (repetitive):
Used like this in handlers:
I have repetitive
Effect.catchTag error handling code in my API handlers. I want to refactor it into reusable helpers, but when I try, the TypeScript typechecker complains and I can’t get the types right.What I’d like:
Define typed, reusable error handlers once, then compose them easily in
pipe or Effect.catchTags, e.g.:I want to avoid repeating full generic signatures for
Effect.catchTag every time.Current code structure (repetitive):
Used like this in handlers:
