2
0
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:
Rogério Chaves
2016-03-02 15:16:01 -03:00
parent 893c061dd6
commit ed4a4dc9a9
+4 -1
View File
@@ -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;