Skip to content

Commit

Permalink
check before running captureStackTrace #4
Browse files Browse the repository at this point in the history
  • Loading branch information
salvocanna committed Apr 3, 2020
2 parents 85eeb58 + fd1a81e commit d9d74ff
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/cuvva-error.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ function CuvvaError(code, reasons, meta) {
}

CuvvaError.super_(code);
Error.captureStackTrace(this, this.constructor);

if (Error.captureStackTrace)
Error.captureStackTrace(this, this.constructor);

this.code = code;
this.reasons = reasons;
Expand Down

0 comments on commit d9d74ff

Please sign in to comment.