Package: effect
Module: Layer
Recovers from all typed errors by switching to another layer.
When to use
Use when every typed Layer construction error should use the same
recovery path.
See
catchTag for recovering from specific tagged errorscatchCause for recovering with access to the full causeSignature
declare const catch: { <E, RIn2, E2, ROut2>(onError: (error: E) => Layer<ROut2, E2, RIn2>): <RIn, ROut>(self: Layer<ROut, E, RIn>) => Layer<ROut & ROut2, E2, RIn2 | RIn>; <RIn, E, ROut, RIn2, E2, ROut2>(self: Layer<ROut, E, RIn>, onError: (error: E) => Layer<ROut2, E2, RIn2>): Layer<ROut & ROut2, E2, RIn | RIn2>; }
Since v4.0.0