验证中...
Languages: JavaScript
Categories: JavaScript 工具
Latest update 2019-01-12 15:36
Axios Axerr
Raw Copy
const CommonAxerrHandlerGen = (resolve) => (axerr) => {
if (axerr.response) {
resolve({
ok: false,
msg: `HTTP ${axerr.response.status} ${axerr.response.statusText} : ${axerr.response.data ?
(axerr.response.data['message'] ? axerr.response.data['message'] : util.inspect(axerr.response.data)) :
"!NO HTTP RESPONSE DATA"}`
})
} else {
resolve({
ok: false,
msg: axerr.message ? axerr.message : util.inspect(axerr)
});
}
};

Comment list( 0 )

You need to Sign in for post a comment

Help Search