From 9fa9cae9b379cb5e49e95af314617338aacbe08a Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 23 Oct 2013 20:32:20 -0700 Subject: [PATCH] packer: don't panic if can't write to UI --- CHANGELOG.md | 2 +- packer/ui.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f1dd2099..d84de8567 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,10 +2,10 @@ BUG FIXES: +* core: Won't panic when writing to a bad pipe. [GH-560] * common/uuid: Use cryptographically secure PRNG when generating UUIDs. [GH-552] - ## 0.3.10 (October 20, 2013) FEATURES: diff --git a/packer/ui.go b/packer/ui.go index 3d82b281a..8ede82703 100644 --- a/packer/ui.go +++ b/packer/ui.go @@ -210,7 +210,7 @@ func (rw *BasicUi) Say(message string) { log.Printf("ui: %s", message) _, err := fmt.Fprint(rw.Writer, message+"\n") if err != nil { - panic(err) + log.Printf("[ERR] Failed to write to UI: %s", err) } } @@ -221,7 +221,7 @@ func (rw *BasicUi) Message(message string) { log.Printf("ui: %s", message) _, err := fmt.Fprint(rw.Writer, message+"\n") if err != nil { - panic(err) + log.Printf("[ERR] Failed to write to UI: %s", err) } } @@ -232,7 +232,7 @@ func (rw *BasicUi) Error(message string) { log.Printf("ui error: %s", message) _, err := fmt.Fprint(rw.Writer, message+"\n") if err != nil { - panic(err) + log.Printf("[ERR] Failed to write to UI: %s", err) } }