From 29ede35b28d21dac4a374379f2d1a803b7f1b884 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 19 Aug 2013 23:21:53 -0700 Subject: [PATCH] packer/rpc: when communicator abruptly exits, set exit status 123 --- packer/rpc/communicator.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packer/rpc/communicator.go b/packer/rpc/communicator.go index c6971a9d7..dc2e570a3 100644 --- a/packer/rpc/communicator.go +++ b/packer/rpc/communicator.go @@ -78,7 +78,8 @@ func (c *communicator) Start(cmd *packer.RemoteCmd) (err error) { conn, err := responseL.Accept() if err != nil { - log.Panic(err) + cmd.SetExited(123) + return } defer conn.Close() @@ -87,7 +88,8 @@ func (c *communicator) Start(cmd *packer.RemoteCmd) (err error) { var finished CommandFinished if err := decoder.Decode(&finished); err != nil { - log.Panic(err) + cmd.SetExited(123) + return } cmd.SetExited(finished.ExitStatus)