From 26105034da4fcce7ac883c899d781f016559310d Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 8 Nov 2018 00:38:48 +0800 Subject: switch to vuepress --- node_modules/schema-utils/src/ValidationError.js | 25 ++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 node_modules/schema-utils/src/ValidationError.js (limited to 'node_modules/schema-utils/src/ValidationError.js') 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; -- cgit v1.2.3