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:
Jo-Philipp Wich 2021-01-19 23:00:52 +01:00 committed by GitHub
commit 03d11de79f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -982,12 +982,13 @@
if (!Poll.active())
return;
var res_json = null;
try {
callback(res, res.json(), res.duration);
}
catch (err) {
callback(res, null, res.duration);
res_json = res.json();
}
catch (err) {}
callback(res, res_json, res.duration);
});
};