DieAn untyped defect — typically a programming error or an uncaught exception.
When to use
Use when inspecting Cause reasons that represent defects instead of typed
failures or interruptions.
Details
The defect property is unknown because defects are not part of the
typed error channel. Use isDieReason to narrow a Reason
to this type.
Example (Accessing the defect)
import { Cause } from "effect"
const cause = Cause.die("Unexpected")
const reason = cause.reasons[0]
if (Cause.isDieReason(reason)) {
console.log(reason.defect) // "Unexpected"
}Source effect/Cause.ts:3283 lines
export interface Die extends Cause.interface Cause<out E>.ReasonProto<Tag extends string>Base interface shared by all reason types (Fail, Die, Interrupt).
Details
Every reason carries:
_tag — discriminant string ("Fail", "Die", or "Interrupt")
annotations — tracing metadata attached by the runtime
annotate() — returns a copy with additional annotations
ReasonProto<"Die"> {
readonly Die.defect: unknowndefect: unknown
}Referenced by 5 symbols