effect-io-ai

Package: effect
Module: Cause

Cause.hasFails

Returns true if the cause contains at least one Fail reason.

When to use

Use to check whether a cause includes typed failures before extracting, mapping, or rendering them.

Example (Checking for typed errors)

import { Cause } from "effect"

console.log(Cause.hasFails(Cause.fail("error"))) // true
console.log(Cause.hasFails(Cause.die("defect"))) // false

See

Signature

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

Source

Since v4.0.0