effect-io-ai

Package: effect
Module: Schema

Schema.catchEncoding

Recovers from an encoding error by providing a fallback value.

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.

See

Signature

declare const catchEncoding: <S extends Constraint>(f: (issue: SchemaIssue.Issue) => Effect.Effect<Option_.Option<S["Encoded"]>, SchemaIssue.Issue>) => (self: S) => middlewareEncoding<S, S["EncodingServices"]>

Source

Since v4.0.0