diff --git a/lib/core/AxiosError.js b/lib/core/AxiosError.js index 2125a4e..b90d27a 100644 --- a/lib/core/AxiosError.js +++ b/lib/core/AxiosError.js @@ -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;