Commit 443ccc53 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

packer/rpc: don't panic on failed Ui calls

parent 9c5e5af2
...@@ -160,7 +160,7 @@ func (c *comm) Upload(path string, input io.Reader) error { ...@@ -160,7 +160,7 @@ func (c *comm) Upload(path string, input io.Reader) error {
return err return err
} }
if _, err := io.Copy(w, input_memory); err != nil{ if _, err := io.Copy(w, input_memory); err != nil {
return err return err
} }
......
...@@ -2,6 +2,7 @@ package rpc ...@@ -2,6 +2,7 @@ package rpc
import ( import (
"github.com/mitchellh/packer/packer" "github.com/mitchellh/packer/packer"
"log"
"net/rpc" "net/rpc"
) )
...@@ -30,7 +31,7 @@ func (u *Ui) Ask(query string) (result string, err error) { ...@@ -30,7 +31,7 @@ func (u *Ui) Ask(query string) (result string, err error) {
func (u *Ui) Error(message string) { func (u *Ui) Error(message string) {
if err := u.client.Call("Ui.Error", message, new(interface{})); err != nil { if err := u.client.Call("Ui.Error", message, new(interface{})); err != nil {
panic(err) log.Printf("Error in Ui RPC call: %s", err)
} }
} }
...@@ -41,19 +42,19 @@ func (u *Ui) Machine(t string, args ...string) { ...@@ -41,19 +42,19 @@ func (u *Ui) Machine(t string, args ...string) {
} }
if err := u.client.Call("Ui.Machine", rpcArgs, new(interface{})); err != nil { if err := u.client.Call("Ui.Machine", rpcArgs, new(interface{})); err != nil {
panic(err) log.Printf("Error in Ui RPC call: %s", err)
} }
} }
func (u *Ui) Message(message string) { func (u *Ui) Message(message string) {
if err := u.client.Call("Ui.Message", message, new(interface{})); err != nil { if err := u.client.Call("Ui.Message", message, new(interface{})); err != nil {
panic(err) log.Printf("Error in Ui RPC call: %s", err)
} }
} }
func (u *Ui) Say(message string) { func (u *Ui) Say(message string) {
if err := u.client.Call("Ui.Say", message, new(interface{})); err != nil { if err := u.client.Call("Ui.Say", message, new(interface{})); err != nil {
panic(err) log.Printf("Error in Ui RPC call: %s", err)
} }
} }
......
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