From 25a15366014ed7153f43d400d755dfb7ca4ac98f Mon Sep 17 00:00:00 2001 From: remittor Date: Sun, 18 Jan 2026 10:00:55 +0300 Subject: [PATCH] luci: Fix error "XHR request timed out" into execAndRead --- .../htdocs/luci-static/resources/view/zapret/tools.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/luci-app-zapret/htdocs/luci-static/resources/view/zapret/tools.js b/luci-app-zapret/htdocs/luci-static/resources/view/zapret/tools.js index 0338dfa..545bc3f 100644 --- a/luci-app-zapret/htdocs/luci-static/resources/view/zapret/tools.js +++ b/luci-app-zapret/htdocs/luci-static/resources/view/zapret/tools.js @@ -392,7 +392,7 @@ return baseclass.extend({ } } if (this.setperm) { - let res = await fs.exec('/bin/busybox', [ 'chmod', '644', tmpFile ]); + let res = await fs.exec('/bin/busybox', [ 'chmod', '' + this.setperm, tmpFile ]); if (res.code != 0) { throw new Error('chmod failed, rc = ' + res.code); } @@ -674,7 +674,14 @@ return baseclass.extend({ return callback(cbarg, retCode, 'ERROR: Process failed with error ' + retCode); } } catch (e) { + let skip_err = false; if (e.message?.includes('RPC call to file/exec failed with error -32000: Object not found')) { + skip_err = true; + } + if (e.message?.includes('XHR request timed out')) { + skip_err = true; + } + if (skip_err) { console.warn('WARN: execAndRead: ' + e.message); return; // goto next timer iteration }