Our website uses cookies to enhance your browsing experience.
Accept
to the top

Lucky hour! Grab a free trial license — offer ends in 00:59:58. Claim now

>
>
>
V7006. An exception is created but...
menu mobile close menu
Additional information
toggle menu Contents

V7006. An exception is created but never used. The 'throw' keyword may be missing.

Apr 03 2026

The analyzer has detected that an error object (Error) is created but not used.

The example:

function checkIndex(index) {
  if (index < 0)
    new Error("Index out of bounds");
  return index;
}

In this case, the error object is created without interrupting the execution flow because the throw keyword is missing.

The fixed code:

function checkIndex(index) {
  if (index < 0)
    throw new Error("Index out of bounds");
  return index;
}

This diagnostic is classified as: