UNPKG

446 BJavaScriptView Raw
1/* eslint-disable
2 strict
3*/
4
5'use strict';
6
7class ValidationError extends Error {
8 constructor(errors, name) {
9 super();
10
11 this.name = 'ValidationError';
12
13 this.message = `${name || ''} Invalid Options\n\n`;
14
15 errors.forEach((err) => {
16 this.message += `options${err.dataPath} ${err.message}\n`;
17 });
18
19 this.errors = errors;
20
21 Error.captureStackTrace(this, this.constructor);
22 }
23}
24
25module.exports = ValidationError;