MCPcopy Create free account
hub / github.com/Effect-TS/effect / SchemaError

Class SchemaError

packages/effect/src/Schema.ts:1219–1247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1217 * @since 4.0.0
1218 */
1219export class SchemaError extends Data.TaggedError("SchemaError")<{
1220 readonly issue: SchemaIssue.Issue
1221}> {
1222 readonly [SchemaErrorTypeId]: typeof SchemaErrorTypeId = SchemaErrorTypeId
1223 constructor(issue: SchemaIssue.Issue) {
1224 const stackTraceLimit = getStackTraceLimit()
1225 setStackTraceLimit(0)
1226 try {
1227 super({ issue })
1228 } finally {
1229 setStackTraceLimit(stackTraceLimit)
1230 }
1231 }
1232 override get message() {
1233 return SchemaIssue.defaultFormatter(this.issue)
1234 }
1235 override toJSON() {
1236 return {
1237 _tag: this._tag,
1238 message: this.message
1239 }
1240 }
1241 override [NodeInspectSymbol]() {
1242 return this.toJSON()
1243 }
1244 override toString() {
1245 return `SchemaError(${this.message})`
1246 }
1247}
1248/**
1249 * Returns `true` if `u` is a {@link SchemaError}.
1250 *

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected