Merge pull request #4742 from cartender/pr/fix_try_catch_poll__master
luci-base: luci.js: fix `LuCI.request.poll.add()` exception handling
This commit is contained in:
commit
03d11de79f
1 changed files with 5 additions and 4 deletions
|
@ -982,12 +982,13 @@
|
||||||
if (!Poll.active())
|
if (!Poll.active())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
var res_json = null;
|
||||||
try {
|
try {
|
||||||
callback(res, res.json(), res.duration);
|
res_json = res.json();
|
||||||
}
|
|
||||||
catch (err) {
|
|
||||||
callback(res, null, res.duration);
|
|
||||||
}
|
}
|
||||||
|
catch (err) {}
|
||||||
|
|
||||||
|
callback(res, res_json, res.duration);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue