diff --git a/lib/core/Axios.js b/lib/core/Axios.js index 2765bbbda3..8eebdc4e0a 100644 --- a/lib/core/Axios.js +++ b/lib/core/Axios.js @@ -40,9 +40,9 @@ class Axios { return await this._request(configOrUrl, config); } catch (err) { if (err instanceof Error) { - let dummy; + let dummy = {}; - Error.captureStackTrace ? Error.captureStackTrace(dummy = {}) : (dummy = new Error()); + Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error()); // slice off the Error: ... line const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';