Cause65
Constructors
dieconstCreates a Cause containing a single Die reason with the given defect.doneconstCreates an Effect that fails with a Done error.emptyconstRepresents a Cause with an empty reasons array.failconstCreates a Cause containing a single Fail reason with the given typed error.fromReasonsconstCreates a Cause from an array of Reason values.interruptconstCreates a Cause containing a single Interrupt reason, optionally carrying the interrupting fiber's ID.makeDieReasonconstCreates a standalone Die reason (not wrapped in a Cause).makeFailReasonconstCreates a standalone Fail reason (not wrapped in a Cause).makeInterruptReasonconstCreates a standalone Interrupt reason (not wrapped in a Cause), optionally carrying the interrupting fiber's ID.Models
CauseinterfaceA structured representation of how an Effect failed.DieinterfaceAn untyped defect — typically a programming error or an uncaught exception.FailinterfaceA typed, expected error produced by Effect.fail.InterruptinterfaceA fiber interruption signal, optionally carrying the ID of the fiber that initiated the interruption.ReasontypeA single entry inside a Cause's reasons array.Type Ids
AsyncFiberErrorTypeIdconstUnique brand present on AsyncFiberError values and used by isAsyncFiberError for runtime checks.DoneTypeIdconstUnique brand for Done values.ExceededCapacityErrorTypeIdconstUnique brand for ExceededCapacityError.IllegalArgumentErrorTypeIdconstUnique brand for IllegalArgumentError.NoSuchElementErrorTypeIdconstUnique brand for NoSuchElementError.ReasonTypeIdconstUnique brand for Reason values, used for runtime type checks via isReason.TimeoutErrorTypeIdconstUnique brand for TimeoutError.TypeIdconstUnique brand for Cause values, used for runtime type checks via isCause.UnknownErrorTypeIdconstUnique brand for UnknownError.Guards
isAsyncFiberErrorconstChecks whether an arbitrary value is an AsyncFiberError.isCauseconstChecks whether an arbitrary value is a Cause.isDieReasonconstNarrows a Reason to Die.isDoneconstChecks whether an arbitrary value is a Done signal.isExceededCapacityErrorconstChecks whether an arbitrary value is an ExceededCapacityError.isFailReasonconstNarrows a Reason to Fail.isIllegalArgumentErrorconstChecks whether an arbitrary value is an IllegalArgumentError.isInterruptReasonconstNarrows a Reason to Interrupt.isNoSuchElementErrorconstChecks whether an arbitrary value is a NoSuchElementError.isReasonconstChecks whether an arbitrary value is a Reason (Fail, Die, or Interrupt).isTimeoutErrorconstChecks whether an arbitrary value is a TimeoutError.isUnknownErrorconstChecks whether an arbitrary value is an UnknownError.Mapping
Filtering
filterInterruptorsconstReturns a Result whose success value is the set of defined fiber IDs from the cause's Interrupt reasons.findDefectconstReturns a Result whose success value is the first defect value from a Die reason in the cause.findDieconstReturns a Result whose success value is the first Die reason in the cause, including its annotations.findErrorconstReturns a Result whose success value is the first typed error value E from a Fail reason in the cause.findErrorOptionconstReturns the first typed error value E from a cause wrapped in Option.some, or Option.none if no Fail reason exists.findFailconstReturns a Result whose success value is the first Fail reason in the cause, including its annotations.findInterruptconstReturns a Result whose success value is the first Interrupt reason in the cause, including its annotations.Destructors
Errors
AsyncFiberErrorinterfaceAn error that occurs when trying to run an async fiber with Effect.runSync.DoneinterfaceA graceful completion signal for queues and streams.ExceededCapacityErrorinterfaceAn error indicating that a bounded resource (queue, pool, semaphore, etc.) has exceeded its capacity.IllegalArgumentErrorinterfaceAn error indicating that a function received an argument that violates its contract (e.g.NoSuchElementErrorinterfaceAn error indicating that an expected value was absent.TimeoutErrorinterfaceAn error indicating that an operation exceeded its time limit.UnknownErrorinterfaceA wrapper for errors whose type is not statically known.YieldableErrorinterfaceBase interface for error classes that can be yielded directly inside Effect.gen.Accessors
Annotations
annotateconstAttaches metadata to every reason in a Cause.annotationsconstReads the merged annotations from all reasons in a Cause.InterruptorStackTraceclassContext annotation used to store the stack frame captured at the point of interruption.reasonAnnotationsconstReads the annotations from a single Reason as a Context.StackTraceclassContext annotation used to store the stack frame captured at the point of failure.Combining
Predicates
hasDiesconstReturns true if the cause contains at least one Die reason.hasFailsconstReturns true if the cause contains at least one Fail reason.hasInterruptsconstReturns true if the cause contains at least one Interrupt reason.hasInterruptsOnlyconstReturns true if every reason in the cause is an Interrupt (and there is at least one reason).