effect-io-ai

Package: effect
Module: SchemaGetter

SchemaGetter.fail

Creates a getter that always fails with the given issue.

When to use

Use when you need a schema getter that unconditionally rejects input.

Details

Example (Defining an always-failing getter)

import { Option, SchemaGetter, SchemaIssue } from "effect"

const rejectAll = SchemaGetter.fail<string, string>(
  (oe) => new SchemaIssue.InvalidValue(oe, { message: "not allowed" })
)

See

Signature

declare const fail: <T, E>(f: (oe: Option.Option<E>) => SchemaIssue.Issue) => Getter<T, E>

Source

Since v4.0.0