mirror of
https://github.com/tenrok/axios.git
synced 2026-05-24 14:04:14 +03:00
Implementing adapter error enhacement
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
var utils = require('./../utils');
|
||||
var transformData = require('./transformData');
|
||||
var enhanceError = require('./enhanceError');
|
||||
|
||||
/**
|
||||
* Dispatch a request to the server using whichever adapter
|
||||
@@ -54,7 +55,7 @@ module.exports = function dispatchRequest(config) {
|
||||
adapter(resolve, reject, config);
|
||||
}
|
||||
} catch (e) {
|
||||
reject(e);
|
||||
reject(enhanceError(e, config));
|
||||
}
|
||||
}).then(function onFulfilled(response) {
|
||||
// Transform response data
|
||||
@@ -67,4 +68,3 @@ module.exports = function dispatchRequest(config) {
|
||||
return response;
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user