View Source Funx.Errors.EffectError exception (funx v0.1.0)

Represents a system-level failure in an effectful computation.

EffectError is raised or returned when a failure occurs during the execution of an Effect stage, such as map, bind, or ap. It is not meant for user-facing validation, but rather for internal tracing, telemetry, and diagnostics.

Fields

  • stage – the name of the effect stage where the error occurred (:map, :bind, :ap, etc.)
  • reason – the term (often an exception) that caused the failure

This error implements the Exception, String.Chars, and Funx.Summarizable behaviours.

Summary

Functions

Creates a new EffectError from the given stage and reason.

Types

@type t() :: %Funx.Errors.EffectError{
  __exception__: true,
  reason: any(),
  stage: atom()
}

Functions

@spec new(atom(), any()) :: t()

Creates a new EffectError from the given stage and reason.

Examples

iex> Funx.Errors.EffectError.new(:bind, %RuntimeError{message: "boom"})
%Funx.Errors.EffectError{stage: :bind, reason: %RuntimeError{message: "boom"}}