resolve on 'exit' not 'close'
This commit is contained in:
parent
5c8a141e68
commit
a32544fbff
1 changed files with 4 additions and 4 deletions
|
@ -12,13 +12,13 @@ function execute(cmd, args) {
|
||||||
spawned.stderr.on('data', function (data) {
|
spawned.stderr.on('data', function (data) {
|
||||||
logger.error(data);
|
logger.error(data);
|
||||||
});
|
});
|
||||||
spawned.on('close', function (code) {
|
spawned.on('error', function (err) {
|
||||||
|
reject('command \'' + cmd + '\' with args \'' + args + '\' encountered an error after ' + util.timeDiff(spawned.timestamp) + 'ms >>> ' + err);
|
||||||
|
});
|
||||||
|
spawned.on('exit', function (code) {
|
||||||
logger.debug('command \'' + cmd + '\' with args \'' + args + '\' finished with exit code ' + code + ' after ' + util.timeDiff(spawned.timestamp) + 'ms');
|
logger.debug('command \'' + cmd + '\' with args \'' + args + '\' finished with exit code ' + code + ' after ' + util.timeDiff(spawned.timestamp) + 'ms');
|
||||||
resolve();
|
resolve();
|
||||||
});
|
});
|
||||||
spawned.on('error', function (err) {
|
|
||||||
return reject('command \'' + cmd + '\' with args \'' + args + '\' encountered an error after ' + util.timeDiff(spawned.timestamp) + 'ms >>> ' + err);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue