Package: effect
Module: Schema
Recovers from a decoding error with a handler that may require Effect services.
When to use
Use when you need decoding fallback logic to require services from the Effect context.
Details
The handler receives the Issue and returns an Effect that either succeeds
with a fallback value or re-fails with a (possibly different) issue. The
handler’s services are added to the schema’s decoding services.
See
catchDecoding for recovery handlers that do not require servicesmiddlewareDecoding for intercepting or replacing the full decoding pipelineSignature
declare const catchDecodingWithContext: <S extends Constraint, R = never>(f: (issue: SchemaIssue.Issue) => Effect.Effect<Option_.Option<S["Type"]>, SchemaIssue.Issue, R>) => (self: S) => middlewareDecoding<S, S["DecodingServices"] | R>
Since v4.0.0