effect-io-ai

Package: effect
Module: Exit

Exit.fail

Creates a failed Exit from a typed error value.

When to use

Use when you need to represent an expected typed failure as an Exit.

Details

The error is wrapped in a Cause.Fail internally.

Returns a Failure<never, E>.

Example (Creating a failed Exit)

import { Exit } from "effect"

const exit = Exit.fail("Something went wrong")
console.log(Exit.isFailure(exit)) // true

See

Signature

declare const fail: <E>(e: E) => Exit<never, E>

Source

Since v2.0.0