mirror of
https://github.com/hashicorp/packer.git
synced 2026-09-25 01:04:00 -04:00
Merge pull request #1411 from chrisfarms/master
fix panic when vagrant cloud response fails
This commit is contained in:
@@ -33,7 +33,12 @@ func (s *stepVerifyBox) Run(state multistep.StateBag) multistep.StepAction {
|
||||
path := fmt.Sprintf("box/%s", config.Tag)
|
||||
resp, err := client.Get(path)
|
||||
|
||||
if err != nil || (resp.StatusCode != 200) {
|
||||
if err != nil {
|
||||
state.Put("error", fmt.Errorf("Error retrieving box: %s", err))
|
||||
return multistep.ActionHalt
|
||||
}
|
||||
|
||||
if resp.StatusCode != 200 {
|
||||
cloudErrors := &VagrantCloudErrors{}
|
||||
err = decodeBody(resp, cloudErrors)
|
||||
state.Put("error", fmt.Errorf("Error retrieving box: %s", cloudErrors.FormatErrors()))
|
||||
|
||||
Reference in New Issue
Block a user