You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When i want to throw erros in the function, it shows "Uncaught Error"
const intercept = require('superagent-intercept')((err, res) => {
if (err) {
throw new Error(err)
}
if (res) {
/**
* code为非0是抛错 可结合自己业务进行修改
*/
const data = res.body
if (data.code !== 0) {
throw new Error(data.message)
}
}
})
request2.js:36 Uncaught Error: 登录失败
at Request.<anonymous> (request2.js:36)
at index.js:8
at Array.forEach (<anonymous>)
at Request.req.callback (index.js:8)
at Request.<anonymous> (client.js:465)
at Request.Emitter.emit (index.js:145)
at XMLHttpRequest.xhr.onreadystatechange (client.js:761)
The text was updated successfully, but these errors were encountered:
When i want to throw erros in the function, it shows "Uncaught Error"
The text was updated successfully, but these errors were encountered: