Package: effect
Module: SchemaIssue
Represents a schema issue produced when a forbidden operation is encountered during parsing,
such as an asynchronous Effect running inside Schema.decodeUnknownSync.
When to use
Use when you need to detect that a schema requires async execution but was run synchronously.
Details
actual is Option.some(value) when the input is known, or
Option.none() when absent.annotations optionally carries a message string."Forbidden operation".Example (Creating a Forbidden issue)
import { Option, SchemaIssue } from "effect"
const issue = new SchemaIssue.Forbidden(
Option.none(),
{ message: "async operation not allowed in sync context" }
)
console.log(String(issue))
// "async operation not allowed in sync context"
See
InvalidValue — for value-constraint failures (not operation failures)Signature
declare class Forbidden { constructor(
/**
* The input value that caused the issue.
*/
actual: Option.Option<unknown>,
/**
* The metadata for the issue.
*/
annotations: Schema.Annotations.Issue | undefined
) }
Since v3.10.0