mirror of
https://github.com/danbulant/docker-compose
synced 2026-06-15 12:41:28 +00:00
handle error based on exit code
This commit is contained in:
parent
a6aa60d51c
commit
1f2a8215f9
1 changed files with 5 additions and 1 deletions
6
index.js
6
index.js
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue