Skip to content

Commit 77ee965

Browse files
aldermoovelziluvatar
authored andcommitted
#402: Don't fail if captureStackTrace is not a function (#410)
1 parent d3f996b commit 77ee965

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/JsonWebTokenError.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
var JsonWebTokenError = function (message, error) {
22
Error.call(this, message);
3-
Error.captureStackTrace(this, this.constructor);
3+
if(Error.captureStackTrace) {
4+
Error.captureStackTrace(this, this.constructor);
5+
}
46
this.name = 'JsonWebTokenError';
57
this.message = message;
68
if (error) this.inner = error;
@@ -9,4 +11,4 @@ var JsonWebTokenError = function (message, error) {
911
JsonWebTokenError.prototype = Object.create(Error.prototype);
1012
JsonWebTokenError.prototype.constructor = JsonWebTokenError;
1113

12-
module.exports = JsonWebTokenError;
14+
module.exports = JsonWebTokenError;

0 commit comments

Comments
 (0)