effect-io-ai

Package: effect
Module: Cause

Cause.keepDefects

Removes all Fail and Interrupt nodes, keeping only defects (Die) in a Cause.

Details

This function strips a cause of recoverable errors and interruptions, leaving only unexpected failures. If no defects remain, it returns None. It’s valuable for focusing only on unanticipated problems when both known errors and defects could occur.

Signature

declare const keepDefects: <E>(self: Cause<E>) => Option.Option<Cause<never>>

Source

Since v2.0.0