Skip to content

No err was throwed when network disconnected #271

@BuggMaker

Description

@BuggMaker

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions