Package: effect
Module: Schema
Recovers from an encoding error with a handler that may require Effect services.
When to use
Use when you need encoding 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 encoded value or re-fails with a (possibly different) issue.
The handler’s services are added to the schema’s encoding services.
See
catchEncoding for recovery handlers that do not require servicesmiddlewareEncoding for intercepting or replacing the full encoding pipelineSignature
declare const catchEncodingWithContext: <S extends Constraint, R = never>(f: (issue: SchemaIssue.Issue) => Effect.Effect<Option_.Option<S["Encoded"]>, SchemaIssue.Issue, R>) => (self: S) => middlewareEncoding<S, S["EncodingServices"] | R>
Since v4.0.0