.. role:: ts-api-decorator

####################
InvalidNodeTypeError
####################

.. container:: ts-api-section

   .. js:class:: InvalidNodeTypeError

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



.. container:: api-index-section

   .. rubric:: Constructors

   .. rst-class:: api-index-list-item api-kind-constructor api-parent-kind-class

   * :js:meth:`~InvalidNodeTypeError.constructor`



.. container:: api-index-section

   .. rubric:: Properties

   .. rst-class:: api-index-list-item api-kind-property api-parent-kind-class

   * :js:attr:`~InvalidNodeTypeError.expectedTypes`
   * :js:attr:`~InvalidNodeTypeError.message`
   * :js:attr:`~InvalidNodeTypeError.name`
   * :js:attr:`~InvalidNodeTypeError.nodeId`
   * :js:attr:`~InvalidNodeTypeError.stack`
   * :js:attr:`~InvalidNodeTypeError.prepareStackTrace`
   * :js:attr:`~InvalidNodeTypeError.stackTraceLimit`



.. container:: api-index-section

   .. rubric:: Methods

   .. rst-class:: api-index-list-item api-kind-method api-parent-kind-class

   * :js:meth:`~InvalidNodeTypeError.captureStackTrace`





------------

Constructors
============

.. container:: ts-api-section

   .. js:function:: InvalidNodeTypeError.constructor( nodeId, expectedTreeType, expectedTreeTypes)

      :param nodeId: None
      :type nodeId: number
      :param expectedTreeType: None
      :type expectedTreeType: TreeNodeType
      :param expectedTreeTypes: None
      :type expectedTreeTypes: [TreeNodeType]


      Creates a new InvalidNodeTypeError


      :rtype: InvalidNodeTypeError



Properties
==========

.. container:: ts-api-section

   .. js:attribute:: InvalidNodeTypeError.expectedTypes

      :type: [NodeType]





.. container:: ts-api-section

   .. js:attribute:: InvalidNodeTypeError.message

      :type: string





.. container:: ts-api-section

   .. js:attribute:: InvalidNodeTypeError.name

      :type: string





.. container:: ts-api-section

   .. js:attribute:: InvalidNodeTypeError.nodeId

      :type: number





.. container:: ts-api-section

   .. js:attribute:: InvalidNodeTypeError.stack

      :type: string :ts-api-decorator:`optional`





.. container:: ts-api-section

   .. js:attribute:: InvalidNodeTypeError.prepareStackTrace

      :type: function :ts-api-decorator:`optional`

      Optional override for formatting stack traces

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


      .. js:function:: prepareStackTrace( err, stackTraces)
         :noindex:

         :param err: None
         :type err: Error
         :param stackTraces: None
         :type stackTraces: [CallSite]


         :rtype: any





.. container:: ts-api-section

   .. js:attribute:: InvalidNodeTypeError.stackTraceLimit

      :type: number





Methods
=======

.. rst-class:: ts-api-section

:ts-api-decorator:`static` captureStackTrace
--------------------------------------------

.. js:method:: InvalidNodeTypeError.captureStackTrace( targetObject[, constructorOpt])

   :param targetObject: None
   :type targetObject: object
   :param constructorOpt: :ts-api-decorator:`optional` None
   :type constructorOpt: Function


   Create .stack property on a target object


   :rtype: void

