Class SpecMismatchException<S, HasKey, K, T>

An exception that can be thrown while generate-ing if the output does not match the expected Specs.

Type Parameters

Hierarchy

Constructors

Properties

actualValue: T

The actual value that was generated.

cause?: unknown
code: "specMismatch"

The code for the exception (one of GenerateExceptionTypes).

expectedType: HasKey extends true
    ? SpecTypeNamesDict<MatchingOutput<S>>[Extract<keyof SpecTypeNamesDict<MatchingOutput<S>>, string>]
    : SpecTypeNamesSingle<MatchingOutput<S>>

The expected SpecTypeName.

key: K

The key of the Specs for which the mismatch occurred, if any.

message: string
meta?: any

Additional metadata for the exception.

name: string
specs: S

The Specs that were expected.

stack?: string
prepareStackTrace?: ((err, stackTraces) => any)

Type declaration

stackTraceLimit: number

Methods

  • Create .stack property on a target object

    Parameters

    • targetObject: object
    • Optional constructorOpt: Function

    Returns void

Generated using TypeDoc