Package: effect
Module: Cause
Returns a Result whose success value is the first Die reason in
the cause, including its annotations. If the cause has no Die reason, the
failure value is the original cause.
When to use
Use when you need the full Die reason from a Cause, including
annotations.
Example (Extracting the first Die reason)
import { Cause, Result } from "effect"
const result = Cause.findDie(Cause.die("defect"))
if (!Result.isFailure(result)) {
console.log(result.success.defect) // "defect"
}
See
findDefect — extract the unwrapped defect valuefindFail — extract the first Fail reasonSignature
declare const findDie: <E>(self: Cause<E>) => Result.Result<Die, Cause<E>>
Since v4.0.0