error.js 364 B

123456789101112131415
  1. export default function HARError(errors) {
  2. let message = 'validation failed';
  3. this.name = 'HARError';
  4. this.message = message;
  5. this.errors = errors;
  6. if (typeof Error.captureStackTrace === 'function') {
  7. Error.captureStackTrace(this, this.constructor);
  8. } else {
  9. this.stack = new Error(message).stack;
  10. }
  11. }
  12. HARError.prototype = Error.prototype;