From 7ced2a7ac64f37ddae5911e9d927761d67020d2b Mon Sep 17 00:00:00 2001 From: Phillip Johnsen Date: Fri, 7 Jun 2019 07:43:45 +0200 Subject: [PATCH] jenkins: also log body when starting build fails --- scripts/trigger-jenkins-build.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/trigger-jenkins-build.js b/scripts/trigger-jenkins-build.js index 6d9cdf40..6c25348e 100644 --- a/scripts/trigger-jenkins-build.js +++ b/scripts/trigger-jenkins-build.js @@ -63,11 +63,11 @@ function triggerBuild (options, cb) { headers: { authorization }, qs: { token: buildAuthToken }, json: { parameters: buildParametersForRepo(options, repo) } - }, (err, response) => { + }, (err, response, body) => { if (err) { return cb(err) } else if (response.statusCode !== 200) { - return cb(new Error(`Expected 200 from Jenkins, got ${response.statusCode}`)) + return cb(new Error(`Expected 200 from Jenkins, got ${response.statusCode}: ${body}`)) } cb(null, { jobName, jobId: response.body.id })