You've already forked goreleaser
mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-07-15 01:34:21 +02:00
fix: panic while access a http response in Artifactory pipeline
When the upload target is not resolvable by tcp (e.g. unknown host) no response object will be generated. In an error case the response object is used (it was assumed that this will be there at every point in time). This commit fixes this behaviour
This commit is contained in:
@ -163,7 +163,12 @@ func doBuild(ctx *context.Context, build config.Build, target buildtarget.Target
|
||||
|
||||
artifact, resp, err := uploadBinaryToArtifactory(ctx, uploadTarget, artifactory.Username, secret, file)
|
||||
if err != nil {
|
||||
if resp != nil {
|
||||
log.WithError(err).Errorf("Artifactory: Upload to target %s failed (HTTP Status: %s)", uploadTarget, resp.Status)
|
||||
} else {
|
||||
log.WithError(err).Errorf("Artifactory: Upload to target %s failed", uploadTarget)
|
||||
}
|
||||
|
||||
continue
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user