Log an upload error closer to when it occurs

When there is an error returned from the Upload it is propagated back
to the main loop and may have additional log messages before the actual
error is displayed. This displays a log message close to where the error
actually occurred.
pull/195/head
Mark Peek 13 years ago
parent a8a53fb0b4
commit ed75091bd4

@ -79,5 +79,9 @@ func (p *Provisioner) Provision(ui packer.Ui, comm packer.Communicator) error {
}
defer f.Close()
return comm.Upload(p.config.Destination, f)
err = comm.Upload(p.config.Destination, f)
if err != nil {
ui.Error(fmt.Sprintf("Upload failed: %s", err))
}
return err
}

Loading…
Cancel
Save