Skip to content

Commit 8966ee7

Browse files
authored
fix(xhr): return original config on errors from XHR adapter (#6515)
1 parent 0e4f9fa commit 8966ee7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/adapters/xhr.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export default isXHRAdapterSupported && function (config) {
9595
return;
9696
}
9797

98-
reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, _config, request));
98+
reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));
9999

100100
// Clean up request
101101
request = null;
@@ -105,7 +105,7 @@ export default isXHRAdapterSupported && function (config) {
105105
request.onerror = function handleError() {
106106
// Real errors are hidden from us by the browser
107107
// onerror should only fire if it's a network error
108-
reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, _config, request));
108+
reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request));
109109

110110
// Clean up request
111111
request = null;
@@ -121,7 +121,7 @@ export default isXHRAdapterSupported && function (config) {
121121
reject(new AxiosError(
122122
timeoutErrorMessage,
123123
transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
124-
_config,
124+
config,
125125
request));
126126

127127
// Clean up request

0 commit comments

Comments
 (0)