Add error check

This commit is contained in:
Gennady Lipenkov 2020-07-08 22:22:55 +03:00
parent 8c1edc2846
commit 409534738a
1 changed files with 4 additions and 0 deletions

View File

@ -241,6 +241,10 @@ func uploadToBucket(s3conn *s3.S3, ui packer.Ui, artifact packer.Artifact, bucke
req.Config.S3ForcePathStyle = aws.Bool(true)
urlStr, _, err := req.PresignRequest(15 * time.Minute)
if err != nil {
ui.Say(fmt.Sprintf("Failed to presign url: %s", err))
return "", err
}
return urlStr, nil
}