Package: effect
Module: Cause
Returns a Result whose success value is the first Interrupt reason
in the cause, including its annotations. If the cause has no Interrupt
reason, the failure value is the original cause.
When to use
Use when you need the first Interrupt reason from a Cause, including the
fiber ID and annotations.
Example (Extracting the first interrupt)
import { Cause, Result } from "effect"
const result = Cause.findInterrupt(Cause.interrupt(42))
if (!Result.isFailure(result)) {
console.log(result.success.fiberId) // 42
}
See
interruptors — collect all interrupting fiber IDs as a SetSignature
declare const findInterrupt: <E>(self: Cause<E>) => Result.Result<Interrupt, Cause<E>>
Since v4.0.0