Skip to content

Commit

Permalink
Fixed AxiosError stack capturing; (#4718)
Browse files Browse the repository at this point in the history
Co-authored-by: Jay <jasonsaayman@gmail.com>
  • Loading branch information
DigitalBrainJS and jasonsaayman committed May 16, 2022
1 parent 65b9295 commit d60d684
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/core/AxiosError.js
Expand Up @@ -16,7 +16,9 @@ function AxiosError(message, code, config, request, response) {
Error.call(this);

if (Error.captureStackTrace) {
Error.captureStackTrace(this);
Error.captureStackTrace(this, this.constructor);
} else {
this.stack = (new Error()).stack;
}

this.message = message;
Expand Down

0 comments on commit d60d684

Please sign in to comment.