Hyperlinkv0.8.0-beta.28

Cause

Cause.findInterruptconsteffect/Cause.ts:1001
<E>(self: Cause<E>): Result.Result<Interrupt, Cause<E>>

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
}
filteringinterruptors
Source effect/Cause.ts:10011 lines
export const findInterrupt: <E>(self: Cause<E>) => Result.Result<Interrupt, Cause<E>> = effect.findInterrupt