effect-io-ai

Package: effect
Module: Exit

Exit.hasDies

Checks whether a failed Exit contains defects (Die reasons).

When to use

Use to check whether an Exit failure cause contains unexpected errors.

Details

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

Example (Checking for defects)

import { Exit } from "effect"

console.log(Exit.hasDies(Exit.die(new Error("bug")))) // true
console.log(Exit.hasDies(Exit.fail("err")))           // false
console.log(Exit.hasDies(Exit.succeed(42)))            // false

See

Signature

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

Source

Since v4.0.0