Skip to content
Unverified Commit 76315860 authored by Giovanni Giacobbi's avatar Giovanni Giacobbi
Browse files

luci-base: luci.js: fix `LuCI.request.poll.add()` exception handling



The try/catch is meant for the `res.json()` call and should apply to that. As it was before, an exception inside the poll callback would cause the callback to be reinvoked without the JSON parameter, which is an odd behaviour. Moreover, it makes it hard to debug because it is completely hidden from the browser console. We now differentiate between exceptions thrown due to bad JSON in `responseText` from exceptions generated inside the callback itself, which are let through for browser console logging.

Signed-off-by: default avatarGiovanni Giacobbi <giovanni@giacobbi.net>
parent bce96172
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment