Package: effect
Module: Exit
Checks whether a failed Exit contains typed errors (Fail reasons).
When to use
Use to distinguish typed failures from defects or interruptions.
Details
Returns false for successful exits. Only checks for Fail reasons in the
Cause. A Cause with only Die or Interrupt reasons returns false.
Example (Checking for typed errors)
import { Exit } from "effect"
console.log(Exit.hasFails(Exit.fail("err"))) // true
console.log(Exit.hasFails(Exit.die(new Error("bug")))) // false
console.log(Exit.hasFails(Exit.succeed(42))) // false
See
hasDies to check for defectshasInterrupts to check for interruptionsSignature
declare const hasFails: <A, E>(self: Exit<A, E>) => self is Failure<A, E>
Since v4.0.0