mirror of
https://github.com/tenrok/axios.git
synced 2026-05-21 13:24:11 +03:00
Uses the same timeout error message on XHR adapter than HTTP adapter
This commit is contained in:
+4
-1
@@ -78,7 +78,10 @@ module.exports = function xhrAdapter(resolve, reject, config) {
|
||||
|
||||
// Handle timeout
|
||||
request.ontimeout = function handleTimeout() {
|
||||
reject(new Error('Timeout'));
|
||||
var err = new Error('timeout of ' + config.timeout + 'ms exceeded');
|
||||
err.timeout = config.timeout;
|
||||
err.code = 'ECONNABORTED';
|
||||
reject(err);
|
||||
|
||||
// Clean up request
|
||||
request = null;
|
||||
|
||||
Reference in New Issue
Block a user