Fix error handling of all the execSync usage

This commit is contained in:
Girish Ramakrishnan
2018-11-23 11:39:00 -08:00
parent a0306c69e1
commit 4142d7a050
4 changed files with 18 additions and 9 deletions
+2
View File
@@ -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);