SchemaError
Errors
SchemaError
Added in v4.0.0
Source
Signature
declare class SchemaError extends YieldableError<this> & { readonly _tag: "SchemaError";} & Readonly<{ readonly issue: Issue;}> { constructor(issue: Issue); readonly "~effect/SchemaError/SchemaError": "~effect/SchemaError/SchemaError"; message: string; toString(): string;}Guards
isSchemaError
Added in v4.0.0
Source
Returns true if u is a SchemaError.
Signature
declare function isSchemaError(u: unknown): u is SchemaError;
Error thrown (or returned as the error channel value) when schema decoding or encoding fails.
Details
The
issuefield contains a structured Issue tree describing every validation failure, including the path to the problematic value and the expected type or constraint. Built-in issues have noactualfield, and built-in messages do not include the rejected value. Other Issue fields and custom annotations or messages are not sanitized.messagerenders the issue tree as a human-readable string.Use isSchemaError to narrow an unknown value to
SchemaError.