error.js 373 B

1234567891011121314151617
  1. function HARError (errors) {
  2. var 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
  13. module.exports = HARError