Skip to content

Commit

Permalink
fix(xhr): return original config on errors from XHR adapter (#6515)
Browse files Browse the repository at this point in the history
  • Loading branch information
ValeraS authored Jul 30, 2024
1 parent 0e4f9fa commit 8966ee7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/adapters/xhr.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export default isXHRAdapterSupported && function (config) {
return;
}

reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, _config, request));
reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));

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

// Clean up request
request = null;
Expand All @@ -121,7 +121,7 @@ export default isXHRAdapterSupported && function (config) {
reject(new AxiosError(
timeoutErrorMessage,
transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
_config,
config,
request));

// Clean up request
Expand Down

0 comments on commit 8966ee7

Please sign in to comment.