mirror of
https://github.com/remittor/zapret-openwrt.git
synced 2026-01-27 04:40:34 +03:00
luci: Fix error "XHR request timed out" into execAndRead
This commit is contained in:
@@ -392,7 +392,7 @@ return baseclass.extend({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.setperm) {
|
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) {
|
if (res.code != 0) {
|
||||||
throw new Error('chmod failed, rc = ' + res.code);
|
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);
|
return callback(cbarg, retCode, 'ERROR: Process failed with error ' + retCode);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
let skip_err = false;
|
||||||
if (e.message?.includes('RPC call to file/exec failed with error -32000: Object not found')) {
|
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);
|
console.warn('WARN: execAndRead: ' + e.message);
|
||||||
return; // goto next timer iteration
|
return; // goto next timer iteration
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user