effect-io-ai

Package: effect
Module: Cause

Cause.fail

Creates a Cause containing a single Fail reason with the given typed error.

When to use

Use to construct a cause from an expected typed error.

Example (Creating a fail cause)

import { Cause } from "effect"

const cause = Cause.fail("Something went wrong")
console.log(cause.reasons.length) // 1
console.log(Cause.isFailReason(cause.reasons[0])) // true

See

Signature

declare const fail: <E>(error: E) => Cause<E>

Source

Since v2.0.0