Skip to content
This repository was archived by the owner on Jun 6, 2023. It is now read-only.

Commit 0f3b838

Browse files
committed
output jobError on job stop with error
1 parent 8892824 commit 0f3b838

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/jobs/create.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,8 @@ function create(params, cb) {
199199
if (!resp.body || !resp.body.state) return new Error('Job state not found.');
200200
var state = resp.body.state;
201201
console.log('Job ' + state);
202-
if (state === 'Stopped' && !state === 'Failed' && !state === 'Running') {
202+
if (state !== 'Stopped' && state !== 'Failed' && state !== 'Running') {
203+
if (state === 'Error' || resp.body.jobError) console.log('Error: ' + resp.body.jobError);
203204
return cb();
204205
}
205206
console.log('Awaiting logs...');
@@ -209,6 +210,7 @@ function create(params, cb) {
209210
if (err) return cb(err);
210211
if (!resp.body || !resp.body.state) return new Error('Job state not found.');
211212
console.log('Job ' + resp.body.state + (resp.body.exitCode || resp.body.exitCode === 0 ? ', exitCode ' + resp.body.exitCode : ''));
213+
if (resp.body.state === 'Error' || resp.body.jobError) console.log('Error: ' + resp.body.jobError);
212214
return cb();
213215
});
214216
});

0 commit comments

Comments
 (0)