mirror of
https://github.com/danbulant/docker-compose
synced 2026-06-24 17:31:53 +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 => {
|
childProc.on('exit', exitCode => {
|
||||||
result.exitCode = exitCode;
|
result.exitCode = exitCode;
|
||||||
resolve(result);
|
if (exitCode !== 0) {
|
||||||
|
return reject(new Error(result.err));
|
||||||
|
}
|
||||||
|
|
||||||
|
return resolve(result);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (options.log) {
|
if (options.log) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue