Package: effect
Module: Exit
Creates a failed Exit from a defect (unexpected error).
When to use
Use when you need unexpected, unrecoverable errors that should not appear in the typed error channel.
Details
The defect is wrapped in a Cause.Die internally.
Returns a Failure<never> with E = never, since defects do not appear in
the typed error channel.
Example (Creating a defect Exit)
import { Exit } from "effect"
const exit = Exit.die(new Error("Unexpected error"))
console.log(Exit.isFailure(exit)) // true
See
fail to create a Failure from a typed errorhasDies to check whether an Exit contains defectsSignature
declare const die: (defect: unknown) => Exit<never>
Since v2.0.0