diff options
Diffstat (limited to 'node_modules/schema-utils/src/ValidationError.js')
| -rw-r--r-- | node_modules/schema-utils/src/ValidationError.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/node_modules/schema-utils/src/ValidationError.js b/node_modules/schema-utils/src/ValidationError.js new file mode 100644 index 00000000..21264b5c --- /dev/null +++ b/node_modules/schema-utils/src/ValidationError.js @@ -0,0 +1,25 @@ +/* eslint-disable + strict +*/ + +'use strict'; + +class ValidationError extends Error { + constructor(errors, name) { + super(); + + this.name = 'ValidationError'; + + this.message = `${name || ''} Invalid Options\n\n`; + + errors.forEach((err) => { + this.message += `options${err.dataPath} ${err.message}\n`; + }); + + this.errors = errors; + + Error.captureStackTrace(this, this.constructor); + } +} + +module.exports = ValidationError; |
