effect-io-ai

Package: effect
Module: Sink

Sink.catch

Handles typed errors from this sink with an effectful fallback value.

When to use

Use to recover from a typed sink failure by producing the replacement result with an Effect.

See

Signature

declare const catch: { <E, A2, E2, R2>(f: (error: Types.NoInfer<E>) => Effect.Effect<A2, E2, R2>): <A, In, L, R>(self: Sink<A, In, L, E, R>) => Sink<A2 | A, In, L, E, R2 | R>; <A, In, L, E, R, A2, E2, R2>(self: Sink<A, In, L, E, R>, f: (error: E) => Effect.Effect<A2, E2, R2>): Sink<A | A2, In, L, E2, R | R2>; }

Source

Since v4.0.0