-
Notifications
You must be signed in to change notification settings - Fork 339
Open
Description
reqwest(reqParams).then(
(res: IResponse = {}) => {
td = Date.now() - ts;
resolve({ tinem: moment().format('HH:mm:ss'), msg: res.resultMsg || 'OK', delay: td });
},
(error: any) => {
td = Date.now() - ts;
reject({
time: moment().format('HH:mm:ss'),
msg: error.resultMsg || 'Network disconnected!',
delay: td,
});
}
);
When I use to like this, the network disconnect won't trigger an exception. And scan the source code, I find that there doesn't have a 'try-catch' or 'throw' as follows:
function handleJsonp(o, fn, err, url) {
...
// Add the script to the DOM head
head.appendChild(script) // error happens, but not handle
...
}
}
Metadata
Metadata
Assignees
Labels
No labels