effect-and-errors

Model domain errors with Data.TaggedError and HttpError in Effect applications.

4.6k|378|Updated Jun 28, 2024
One-click install
npx skills add https://github.com/latitude-dev/latitude-llm --skill effect-and-errors
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: effect-and-errors
Source: https://github.com/latitude-dev/latitude-llm/tree/main/.agents/skills/effect-and-errors
Command: npx skills add https://github.com/latitude-dev/latitude-llm --skill effect-and-errors

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Composes and propagates domain errors and HTTP-aware errors in Effect programs, enabling reliable failure handling across services.

Core Features & Use Cases

  • Define domain errors with Data.TaggedError and implement HttpError for HTTP-boundaries.
  • Standardize error propagation through Effect streams, with observability integration via spans.
  • Use typed errors at boundaries to prevent leakage of internal state and to drive consistent HTTP responses.

Quick Start

Write a simple use case that defines a domain error with HttpError, and propagate it through an Effect-based workflow.

Frequently Asked Questions about effect-and-errors

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

FAQPage Schema
How do I handle domain errors in Effect applications?

To handle domain errors in Effect applications, define them using Data.TaggedError to ensure predictable failure modes and standardize error typing across domain services and repository interactions.

What's the best way to standardize HTTP error responses in Effect?

Standardize HTTP error responses in Effect by implementing HttpError with httpStatus and httpMessage properties, applying this structure across HTTP boundaries to drive consistent responses and prevent internal state leakage.

How do I add observability to error handling in Effect streams?

Add observability to error handling in Effect streams by wrapping use cases with Effect.withSpan and executing them through Effect.runPromise patterns to track error propagation and failure modes.

Can I use typed errors to prevent internal state leakage at HTTP boundaries?

Typed errors prevent internal state leakage at HTTP boundaries by using Data.TaggedError to model domain errors and implementing HttpError to ensure only safe, structured responses are exposed.

Why does my Effect workflow fail to propagate errors predictably?

Effect workflows fail to propagate errors predictably when domain errors are not structured with Data.TaggedError, missing standardized error typing and propagation logic across services and HTTP boundaries.

Does the effect-and-errors Skill support composing errors across multiple services?

The effect-and-errors Skill supports composing and propagating domain errors and HTTP-aware errors across multiple services in Effect programs, enabling reliable failure handling throughout the application architecture.