# InvalidNodeTypeError

class InvalidNodeTypeError()

  Error object that is thrown when the user passes a node of the incorrect type to a function.

Constructors

- `constructor()`

Properties

- `expectedTypes`

- `message`

- `name`

- `nodeId`

- `stack`

- `prepareStackTrace`

- `stackTraceLimit`

Methods

- `captureStackTrace()`

## Constructors

InvalidNodeTypeError.constructor(nodeId, expectedTreeType, expectedTreeTypes)
  Arguments

    - nodeId (`number()`) – None

    - expectedTreeType (`TreeNodeType()`) – None

    - expectedTreeTypes (`[TreeNodeType]()`) – None

  Creates a new InvalidNodeTypeError

  Return type

    InvalidNodeTypeError

## Properties

InvalidNodeTypeError.expectedTypes
  Type

    [NodeType]

InvalidNodeTypeError.message
  Type

    string

InvalidNodeTypeError.name
  Type

    string

InvalidNodeTypeError.nodeId
  Type

    number

InvalidNodeTypeError.stack
  Type

    string optional

InvalidNodeTypeError.prepareStackTrace
  Type

    function optional

  Optional override for formatting stack traces

  See

    https://v8.dev/docs/stack-trace-api#customizing-stack-traces

  InvalidNodeTypeError.prepareStackTrace(err, stackTraces)
    Arguments

      - err (`Error()`) – None

      - stackTraces (`[CallSite]()`) – None

    Return type

      any

InvalidNodeTypeError.stackTraceLimit
  Type

    number

## Methods

### static captureStackTrace

InvalidNodeTypeError.captureStackTrace(targetObject[, constructorOpt])
  Arguments

    - targetObject (`object()`) – None

    - constructorOpt (`Function()`) – optional None

  Create .stack property on a target object

  Return type

    void