Authored by 李奇

wx.request报错区分超时和错误码上报

... ... @@ -152,9 +152,15 @@ function request(method = 'GET') {
}
},
fail: function (err) {
const ERROR_TYPE = {
['request:fail']: 'NETWORK_API_CODE_ERR',
['request:fail timeout']: 'NETWORK_API_TIMEOUT'
};
const errType = ERROR_TYPE[err && err.errMsg || ''] || '';
appReport({
pt: 'NETWORK',
pn: 'NETWORK_API_CODE_ERR',
pn: errType,
param: {
url: url,
st: JSON.stringify(err || {})
... ... @@ -252,9 +258,15 @@ function request(method = 'GET') {
}
},
fail: function (err) {
const ERROR_TYPE = {
['request:fail']: 'NETWORK_API_CODE_ERR',
['request:fail timeout']: 'NETWORK_API_TIMEOUT'
};
const errType = ERROR_TYPE[err && err.errMsg || ''] || '';
appReport({
pt: 'NETWORK',
pn: 'NETWORK_API_CODE_ERR',
pn: errType,
param: {
url: url,
st: JSON.stringify(err || {})
... ...