Skip to content

Commit

Permalink
auth0#402: Don't fail if captureStackTrace is not a function
Browse files Browse the repository at this point in the history
  • Loading branch information
aldermoovel committed Sep 27, 2017
1 parent 128a9e1 commit 2d1e579
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/JsonWebTokenError.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
var JsonWebTokenError = function (message, error) {
Error.call(this, message);
Error.captureStackTrace(this, this.constructor);
if(Error.captureStackTrace) {
Error.captureStackTrace(this, this.constructor);
}
this.name = 'JsonWebTokenError';
this.message = message;
if (error) this.inner = error;
Expand All @@ -9,4 +11,4 @@ var JsonWebTokenError = function (message, error) {
JsonWebTokenError.prototype = Object.create(Error.prototype);
JsonWebTokenError.prototype.constructor = JsonWebTokenError;

module.exports = JsonWebTokenError;
module.exports = JsonWebTokenError;

0 comments on commit 2d1e579

Please sign in to comment.