handle error based on exit code

This commit is contained in:
Alexander Zeitler 2019-05-23 21:06:43 +02:00 committed by Paweł Niedzielski
parent a6aa60d51c
commit 1f2a8215f9

View file

@ -82,7 +82,11 @@ const execCompose = (command, args, options) => new Promise((resolve, reject) =>
childProc.on('exit', exitCode => {
result.exitCode = exitCode;
resolve(result);
if (exitCode !== 0) {
return reject(new Error(result.err));
}
return resolve(result);
});
if (options.log) {