Skip to content

Commit

Permalink
Changed error.stack type checking (resolves #1490)
Browse files Browse the repository at this point in the history
  • Loading branch information
tabarra committed Oct 7, 2020
1 parent 3bf3e3b commit c15bbe8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/core/index.ts
Expand Up @@ -1222,7 +1222,7 @@ export class RequestError extends Error {
this.timings = this.request?.timings;

// Recover the original stacktrace
if (!is.undefined(error.stack)) {
if (is.string(error.stack)) {
const indexOfMessage = this.stack.indexOf(this.message) + this.message.length;
const thisStackTrace = this.stack.slice(indexOfMessage).split('\n').reverse();
const errorStackTrace = error.stack.slice(error.stack.indexOf(error.message!) + error.message!.length).split('\n').reverse();
Expand Down

0 comments on commit c15bbe8

Please sign in to comment.