Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No err was throwed when network disconnected #271

Open
BuggMaker opened this issue Jun 12, 2018 · 0 comments
Open

No err was throwed when network disconnected #271

BuggMaker opened this issue Jun 12, 2018 · 0 comments

Comments

@BuggMaker
Copy link

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
...
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant