effect-io-ai

Package: effect
Module: Cause

Cause.hasInterruptsOnly

Returns true if every reason in the cause is an Interrupt (and there is at least one reason).

When to use

Use when you need to detect failures caused only by interruption.

Example (Checking interrupt-only causes)

import { Cause } from "effect"

console.log(Cause.hasInterruptsOnly(Cause.interrupt(123))) // true
console.log(Cause.hasInterruptsOnly(Cause.fail("error")))  // false
console.log(Cause.hasInterruptsOnly(Cause.empty))          // false

See

Signature

declare const hasInterruptsOnly: <E>(self: Cause<E>) => boolean

Source

Since v4.0.0