effect-io-ai

Package: effect
Module: Exit

Exit.hasInterrupts

Checks whether a failed Exit contains interruptions (Interrupt reasons).

When to use

Use to check whether an Exit contains fiber interruption.

Details

Returns false for successful exits. Only checks for Interrupt reasons in the Cause. A Cause with only Fail or Die reasons returns false.

Example (Checking for interruptions)

import { Exit } from "effect"

console.log(Exit.hasInterrupts(Exit.interrupt(1))) // true
console.log(Exit.hasInterrupts(Exit.fail("err")))  // false
console.log(Exit.hasInterrupts(Exit.succeed(42)))   // false

See

Signature

declare const hasInterrupts: <A, E>(self: Exit<A, E>) => self is Failure<A, E>

Source

Since v4.0.0