-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(HARError): revert: need to run in the browser overlooked
- Loading branch information
Ahmad Nassri
committed
Mar 14, 2017
1 parent
ea17fb1
commit cb5ff5f
Showing
1 changed file
with
14 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |