Log response status while handling artifacts only when response <> nil

parent 0277ff77
Pipeline #3781998 passed with stage
in 10 minutes and 51 seconds
......@@ -15,6 +15,9 @@ v 1.4.0
- Fix Absolute method for absolute path discovering for bash
- Fix zombie issues by using dumb-init instead of github.com/ramr/go-reaper
v 1.3.4
- Fix panic while artifacts handling errors
v 1.3.2
- Fix architecture detection bug introduced in 1.3.1
......
......@@ -324,11 +324,14 @@ func (n *GitLabClient) UploadRawArtifacts(config common.BuildCredentials, reader
res, err := n.doRaw(mappedConfig, "POST", fmt.Sprintf("builds/%d/artifacts?%s", config.ID, query.Encode()), pr, mpw.FormDataContentType(), headers)
log := logrus.WithFields(logrus.Fields{
"id": config.ID,
"token": helpers.ShortenToken(config.Token),
"responseStatus": res.Status,
"id": config.ID,
"token": helpers.ShortenToken(config.Token),
})
if res != nil {
log = log.WithField("responseStatus", res.Status)
}
if err != nil {
log.WithError(err).Errorln("Uploading artifacts to coordinator...", "error")
return common.UploadFailed
......@@ -396,6 +399,10 @@ func (n *GitLabClient) DownloadArtifacts(config common.BuildCredentials, artifac
"token": helpers.ShortenToken(config.Token),
})
if res != nil {
log = log.WithField("responseStatus", res.Status)
}
if err != nil {
log.Errorln("Downloading artifacts from coordinator...", "error", err.Error())
return common.DownloadFailed
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment