Hyperlinkv0.8.0-beta.28

Exit

Exit.isFailureconsteffect/Exit.ts:431
<A, E>(self: Exit<A, E>): self is Failure<A, E>

Checks whether an Exit is a Failure.

When to use

Use as a type guard to narrow Exit<A, E> to Failure<A, E> and access the cause property.

Example (Narrowing to failure)

import { Exit } from "effect"

const exit = Exit.fail("error")

if (Exit.isFailure(exit)) {
  console.log(exit.cause)
}
Source effect/Exit.ts:4311 lines
export const isFailure: <A, E>(self: Exit<A, E>) => self is Failure<A, E> = effect.exitIsFailure
Referenced by 7 symbols