mirror of
https://github.com/tenrok/axios.git
synced 2026-06-14 18:42:33 +03:00
@@ -63,6 +63,16 @@ module.exports = function xhrAdapter(resolve, reject, config) {
|
||||
request = null;
|
||||
};
|
||||
|
||||
// Handle low level network errors
|
||||
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 Error('Network Error'));
|
||||
|
||||
// Clean up request
|
||||
request = null;
|
||||
};
|
||||
|
||||
// Add xsrf header
|
||||
// This is only done if running in a standard browser environment.
|
||||
// Specifically not if we're in a web worker, or react-native.
|
||||
|
||||
Reference in New Issue
Block a user