luci-base: rpc.js: revamp error handling, add interceptor support
authorJo-Philipp Wich <jo@mein.io>
Wed, 11 Sep 2019 07:25:11 +0000 (09:25 +0200)
committerJo-Philipp Wich <jo@mein.io>
Wed, 11 Sep 2019 07:25:11 +0000 (09:25 +0200)
commitf141433f5e38153e9dfbb8b320dfa70db1a47cf2
tree3020f81be52e291f18921fae640c3d6c94afe1f1
parent43d8e98a15072ff8f53d343a6a3fa1f59fcd175c
luci-base: rpc.js: revamp error handling, add interceptor support

Add two new functions L.rpc.addInterceptor() and L.rpc.removeInterceptor()
which allow to register and remove interceptor functions which are invoked
before the rpc reply result promise is fulfilled.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/htdocs/luci-static/resources/rpc.js