Package: effect
Module: Cause
Returns the first typed error value E from a cause wrapped in
Option.some, or Option.none if no Fail reason exists.
When to use
Use when you need the first typed error value from a Cause as an Option,
discarding the original cause.
Example (Extracting an error as Option)
import { Cause, Option } from "effect"
const some = Cause.findErrorOption(Cause.fail("error"))
console.log(Option.isSome(some)) // true
const none = Cause.findErrorOption(Cause.die("defect"))
console.log(Option.isNone(none)) // true
See
findError — Result-based variantSignature
declare const findErrorOption: <E>(input: Cause<E>) => Option<E>
Since v4.0.0