Fix error handling of all the execSync usage
This commit is contained in:
@@ -22,6 +22,8 @@ function collectLogs(unitName, callback) {
|
||||
assert.strictEqual(typeof callback, 'function');
|
||||
|
||||
var logs = safe.child_process.execSync('sudo ' + COLLECT_LOGS_CMD + ' ' + unitName, { encoding: 'utf8' });
|
||||
if (!logs) return callback(safe.error);
|
||||
|
||||
logs = logs + '\n\n=====================================\n\n';
|
||||
|
||||
callback(null, logs);
|
||||
|
||||
Reference in New Issue
Block a user