V7006. An exception is created but never used. The 'throw' keyword may be missing.
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;
}