提交 235c19c8 编写于 作者: R Rubén Norte

Implementing adapter error enhacement

上级 75f9b8c5
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
var utils = require('./../utils'); var utils = require('./../utils');
var transformData = require('./transformData'); var transformData = require('./transformData');
var enhanceError = require('./enhanceError');
/** /**
* Dispatch a request to the server using whichever adapter * Dispatch a request to the server using whichever adapter
...@@ -54,7 +55,7 @@ module.exports = function dispatchRequest(config) { ...@@ -54,7 +55,7 @@ module.exports = function dispatchRequest(config) {
adapter(resolve, reject, config); adapter(resolve, reject, config);
} }
} catch (e) { } catch (e) {
reject(e); reject(enhanceError(e, config));
} }
}).then(function onFulfilled(response) { }).then(function onFulfilled(response) {
// Transform response data // Transform response data
...@@ -67,4 +68,3 @@ module.exports = function dispatchRequest(config) { ...@@ -67,4 +68,3 @@ module.exports = function dispatchRequest(config) {
return response; return response;
}); });
}; };
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册