Add rule name and file/string identifier to Error message thrown by onError validation for rules.

This commit is contained in:
David Anson 2023-10-07 19:32:29 -07:00
parent 74f4163a10
commit d2faf40e6a
3 changed files with 16 additions and 8 deletions

View file

@ -604,7 +604,8 @@ function lintContent(
// eslint-disable-next-line jsdoc/require-jsdoc
function throwError(property) {
throw new Error(
"Property '" + property + "' of onError parameter is incorrect.");
// eslint-disable-next-line max-len
`Value of '${property}' passed to onError by '${ruleName}' is incorrect for '${name}'.`);
}
// eslint-disable-next-line jsdoc/require-jsdoc
function onError(errorInfo) {