Hyperlinkv0.8.0-beta.28

Cause

Cause.failconsteffect/Cause.ts:490
<E>(error: E): Cause<E>

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
constructorsdieinterrupt
Source effect/Cause.ts:4901 lines
export const fail: <E>(error: E) => Cause<E> = core.causeFail
Referenced by 2 symbols