post-processor/vagrant-cloud: fix dropped errors
This commit is contained in:
parent
e4e70f80ae
commit
21f2e67462
|
@ -145,6 +145,9 @@ func (p *PostProcessor) PostProcess(ctx context.Context, ui packer.Ui, artifact
|
|||
|
||||
// Determine the name of the provider for Vagrant Cloud, and Vagrant
|
||||
providerName, err := getProvider(artifact.Id(), artifact.Files()[0], builtins[artifact.BuilderId()])
|
||||
if err != nil {
|
||||
return nil, false, false, fmt.Errorf("error getting provider name: %s", err)
|
||||
}
|
||||
|
||||
p.config.ctx.Data = &boxDownloadUrlTemplate{
|
||||
ArtifactId: artifact.Id(),
|
||||
|
|
|
@ -46,6 +46,9 @@ func (s *stepCreateProvider) Run(ctx context.Context, state multistep.StateBag)
|
|||
if err != nil || (resp.StatusCode != 200) {
|
||||
cloudErrors := &VagrantCloudErrors{}
|
||||
err = decodeBody(resp, cloudErrors)
|
||||
if err != nil {
|
||||
ui.Error(fmt.Sprintf("error decoding error response: %s", err))
|
||||
}
|
||||
state.Put("error", fmt.Errorf("Error creating provider: %s", cloudErrors.FormatErrors()))
|
||||
return multistep.ActionHalt
|
||||
}
|
||||
|
|
|
@ -43,6 +43,9 @@ func (s *stepCreateVersion) Run(ctx context.Context, state multistep.StateBag) m
|
|||
if err != nil || (resp.StatusCode != 200) {
|
||||
cloudErrors := &VagrantCloudErrors{}
|
||||
err = decodeBody(resp, cloudErrors)
|
||||
if err != nil {
|
||||
ui.Error(fmt.Sprintf("error decoding error response: %s", err))
|
||||
}
|
||||
state.Put("error", fmt.Errorf("Error creating version: %s", cloudErrors.FormatErrors()))
|
||||
return multistep.ActionHalt
|
||||
}
|
||||
|
|
|
@ -36,6 +36,9 @@ func (s *stepPrepareUpload) Run(ctx context.Context, state multistep.StateBag) m
|
|||
} else {
|
||||
cloudErrors := &VagrantCloudErrors{}
|
||||
err = decodeBody(resp, cloudErrors)
|
||||
if err != nil {
|
||||
ui.Error(fmt.Sprintf("error decoding error response: %s", err))
|
||||
}
|
||||
state.Put("error", fmt.Errorf("Error preparing upload: %s", cloudErrors.FormatErrors()))
|
||||
}
|
||||
return multistep.ActionHalt
|
||||
|
|
|
@ -43,6 +43,9 @@ func (s *stepVerifyBox) Run(ctx context.Context, state multistep.StateBag) multi
|
|||
if resp.StatusCode != 200 {
|
||||
cloudErrors := &VagrantCloudErrors{}
|
||||
err = decodeBody(resp, cloudErrors)
|
||||
if err != nil {
|
||||
ui.Error(fmt.Sprintf("error decoding error response: %s", err))
|
||||
}
|
||||
state.Put("error", fmt.Errorf("Error retrieving box: %s", cloudErrors.FormatErrors()))
|
||||
return multistep.ActionHalt
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue