1cda9cb4f01b5dad380087b8fc1e42faf552eb04d23f87f131b07ca00ccd24c65ceb64dbb355fcb52d54ca63dc4e492f334985286b39eed50452ae56301216 446 B

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