An error that occurs when a task violates a logical condition that is assumed to be true at all times.

Hierarchy

  • Error
    • InvariantError

Constructors

  • Parameters

    • Optional message: string

    Returns InvariantError

  • Parameters

    • Optional message: string
    • Optional options: ErrorOptions

    Returns InvariantError

Properties

cause?: unknown
message: string
name: "InvariantError" = ...
stack?: string
prepareStackTrace?: ((err, stackTraces) => any)

Optional override for formatting stack traces

Type declaration

stackTraceLimit: number

Methods

  • Create .stack property on a target object

    Parameters

    • targetObject: object
    • Optional constructorOpt: Function

    Returns void