mirror of
https://github.com/tenrok/axios.git
synced 2026-06-17 19:21:29 +03:00
fix(xhr): return original config on errors from XHR adapter (#6515)
This commit is contained in:
committed by
GitHub
parent
0e4f9fa290
commit
8966ee7ea6
+3
-3
@@ -95,7 +95,7 @@ export default isXHRAdapterSupported && function (config) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, _config, request));
|
reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));
|
||||||
|
|
||||||
// Clean up request
|
// Clean up request
|
||||||
request = null;
|
request = null;
|
||||||
@@ -105,7 +105,7 @@ export default isXHRAdapterSupported && function (config) {
|
|||||||
request.onerror = function handleError() {
|
request.onerror = function handleError() {
|
||||||
// Real errors are hidden from us by the browser
|
// Real errors are hidden from us by the browser
|
||||||
// onerror should only fire if it's a network error
|
// 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
|
// Clean up request
|
||||||
request = null;
|
request = null;
|
||||||
@@ -121,7 +121,7 @@ export default isXHRAdapterSupported && function (config) {
|
|||||||
reject(new AxiosError(
|
reject(new AxiosError(
|
||||||
timeoutErrorMessage,
|
timeoutErrorMessage,
|
||||||
transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
|
transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
|
||||||
_config,
|
config,
|
||||||
request));
|
request));
|
||||||
|
|
||||||
// Clean up request
|
// Clean up request
|
||||||
|
|||||||
Reference in New Issue
Block a user