Skip to main content

SchemaValidationError

Thrown when a property of a schema fails its validation. Carries what the validator threw.

@group

Errors/Schema

@throws

When a property of a schema fails its validation.

Hierarchy

Index

Constructors

constructor

  • SchemaValidationError(message: string, schemaClassName: string, validationError: unknown): SchemaValidationError
  • Parameters

    • message: string

      The error message.

    • schemaClassName: string

      The schema the value was being read as.

    • validationError: unknown

      What the validator threw.

    Returns SchemaValidationError

Properties

readonlyinheritedschemaClassName

schemaClassName: string

The name of the schema class, or of the class whose schema was looked for.

readonlyvalidationError

validationError: unknown

What the validator threw. 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.