Hyperlinkv0.8.0-beta.28

Cause

Cause.hasInterruptsOnlyconsteffect/Cause.ts:642
<E>(self: Cause<E>): boolean

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
predicateshasInterrupts
Source effect/Cause.ts:6421 lines
export const hasInterruptsOnly: <E>(self: Cause<E>) => boolean = effect.hasInterruptsOnly
Referenced by 6 symbols