2
0
mirror of https://github.com/tenrok/axios.git synced 2026-05-15 11:59:42 +03:00

fix(xhr): return original config on errors from XHR adapter (#6515)

This commit is contained in:
Valerii Sidorenko
2024-07-30 20:38:22 +02:00
committed by GitHub
parent 0e4f9fa290
commit 8966ee7ea6
+3 -3
View File
@@ -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;
@@ -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;
@@ -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