Skip to main content

SchemaError

Thrown when a value does not satisfy the schema it is being read as - a property missing, or one that cannot be resolved.

@group

Errors/Schema

Hierarchy

  • Error
    • SchemaError

Index

Constructors

constructor

  • SchemaError(message: string, schemaClassName: string, validationError?: unknown): SchemaError
  • Parameters

    • message: string

      The error message.

    • schemaClassName: string

      The schema the value was being read as.

    • optionalvalidationError: unknown

      What a validator threw underneath, where there is one.

    Returns SchemaError

Properties

readonlyschemaClassName

schemaClassName: string

optionalreadonlyvalidationError

validationError?: unknown

What a validator threw underneath, where this error is wrapping one. Carried as a property of its own rather than as the Error cause: without it a nested property's failure reads only as the name of the top-level input it arrived under, and which value failed is the whole question.