try catch

This commit is contained in:
dongpd 2020-05-26 13:40:45 +07:00
parent acdbf18d9c
commit 2fe3229317

View File

@ -59,12 +59,19 @@ exports.Reset = async function (req, res) {
const { execSync } = require('child_process'); const { execSync } = require('child_process');
execSync('sudo systemctl stop S905X_BI'); execSync('sudo systemctl stop S905X_BI');
execSync('sudo systemctl disable S905X_BI'); execSync('sudo systemctl disable S905X_BI');
execSync('rm /root/monitor/setup/engine.json'); try {
execSync('rm /root/monitor/setup/engine.json');
if (req.body.path !== "") { } catch(err) {
execSync('rm -rf ' + req.body.path); //console.log(err);
} }
if (req.body.path !== "") {
try {
execSync('rm -rf ' + req.body.path);
} catch(err) {
//console.log(err);
}
}
res.send({status:true}); res.send({status:true});
}; };