Package: effect
Module: Schema
Returns true if u is a SchemaError.
Example (Narrowing Schema errors in a catch block)
import { Schema } from "effect"
try {
Schema.decodeUnknownSync(Schema.Number)("oops")
} catch (err) {
if (Schema.isSchemaError(err)) {
console.log(err._tag) // "SchemaError"
}
}
Signature
declare const isSchemaError: (u: unknown) => u is SchemaError
Since v4.0.0