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