Skip to content

Commit

Permalink
Merge pull request #18 from greenkeeperio/feat/log-webhook-error
Browse files Browse the repository at this point in the history
Feat/log webhook error
  • Loading branch information
janl authored Jul 28, 2017
2 parents 7809891 + 0132030 commit 6c93069
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,14 @@ request({
return console.log('Announced', packageName + '@' + packageVersion, 'to Greenkeeper')
}

log.error('postpublish',
res.statusCode + ' ' +
res.statusMessage +
(res.body.message ? ': ' + res.body.message : '')
)
let errorMessage = ''
if (!res.statusCode || !res.statusMessage) {
errorMessage = JSON.stringify(res) + '\n' + JSON.stringify(data)
} else {
errorMessage = res.statusCode + ' ' +
res.statusMessage +
(res.body.message ? ': ' + res.body.message : '')
}

log.error('postpublish', errorMessage)
})

0 comments on commit 6c93069

Please sign in to comment.