Commit 6a3c9921 authored by Jack Pearkes's avatar Jack Pearkes

post-processor/vagrant-cloud: better errors in box verifcation

parent a0c15382
......@@ -33,8 +33,10 @@ func (s *stepVerifyBox) Run(state multistep.StateBag) multistep.StepAction {
path := fmt.Sprintf("box/%s", config.Tag)
resp, err := client.Get(path)
if err != nil {
state.Put("error", fmt.Errorf("Error retrieving box: %s", err))
if err != nil || (resp.StatusCode != 200) {
cloudErrors := &VagrantCloudErrors{}
err = decodeBody(resp, cloudErrors)
state.Put("error", fmt.Errorf("Error retrieving box: %s", cloudErrors.FormatErrors()))
return multistep.ActionHalt
}
......@@ -46,7 +48,7 @@ func (s *stepVerifyBox) Run(state multistep.StateBag) multistep.StepAction {
}
if box.Tag != config.Tag {
state.Put("error", fmt.Errorf("Could not verify box: %s", err))
state.Put("error", fmt.Errorf("Could not verify box: %s", config.Tag))
return multistep.ActionHalt
}
......
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