Skip to content

Commit

Permalink
fix(HARError): revert: need to run in the browser overlooked
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmad Nassri committed Mar 14, 2017
1 parent ea17fb1 commit cb5ff5f
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions lib/error.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
'use strict'

const ExtendableError = require('@ahmadnassri/error')
function HARError (errors) {
let message = 'validation failed'

module.exports = class HARError extends ExtendableError {
constructor (errors) {
super('validation failed')
this.errors = errors
this.name = 'HARError'
this.message = message
this.errors = errors

if (typeof Error.captureStackTrace === 'function') {
Error.captureStackTrace(this, this.constructor)
} else {
this.stack = (new Error(message)).stack
}
}

HARError.prototype = Error.prototype

module.exports = HARError

0 comments on commit cb5ff5f

Please sign in to comment.