Package: effect
Module: Exit
Extracts the Failure variant from an Exit as a Result.
When to use
Use when composing Exit checks with Filter or other Result-based
filtering APIs and you want the full Failure wrapper.
Details
Returns Result.succeed(failure) when the Exit is a Failure, or
Result.fail(success) with the original Success otherwise.
Gotchas
This is not an Option accessor or an Effect failure. A failed extraction is
represented as data in the Result failure channel.
Example (Filtering for failure)
import { Exit, Result } from "effect"
const exit = Exit.fail("err")
const result = Exit.filterFailure(exit)
console.log(Result.isSuccess(result)) // true
See
filterSuccess for the inversefilterCause to extract the Cause directlySignature
declare const filterFailure: <A, E>(self: Exit<A, E>) => Result.Result<Failure<never, E>, Success<A>>
Since v4.0.0