UNPKG

699 BJavaScriptView Raw
1var util = require('util');
2
3
4var ValidaInvalidError = module.exports = function ValidaInvalidError (validationErrors) {
5 var message = 'validaInvalidError';
6
7 Error.call(this);
8
9 this.name = this.constructor.name;
10 this.validationErrors = validationErrors;
11
12 Object.defineProperty(
13 this,
14 'message',
15 {
16 enumerable: false,
17 value: message,
18 writable: true,
19 }
20 );
21
22 if (Error.hasOwnProperty('captureStackTrace')) {
23 Error.captureStackTrace(this, this.constructor);
24 return;
25 }
26
27 Object.defineProperty(
28 this,
29 'stack',
30 {
31 enumerable: false,
32 value: (new Error(message)).stack,
33 }
34 );
35};
36
37
38util.inherits(ValidaInvalidError, Error);