diff --git a/common/multistep_runner.go b/common/multistep_runner.go index e3c16e7cf..b34ee3a04 100644 --- a/common/multistep_runner.go +++ b/common/multistep_runner.go @@ -71,6 +71,10 @@ func (s abortStep) Run(ctx context.Context, state multistep.StateBag) multistep. } func (s abortStep) Cleanup(state multistep.StateBag) { + err, ok := state.GetOk("error") + if ok { + s.ui.Error(fmt.Sprintf("%s", err)) + } if _, ok := state.GetOk(multistep.StateCancelled); ok { s.ui.Error("Interrupted, aborting...") os.Exit(1) @@ -99,6 +103,11 @@ func (s askStep) Run(ctx context.Context, state multistep.StateBag) (action mult return } + err, ok := state.GetOk("error") + if ok { + s.ui.Error(fmt.Sprintf("%s", err)) + } + switch ask(s.ui, typeName(s.step), state) { case askCleanup: return diff --git a/communicator/ssh/communicator.go b/communicator/ssh/communicator.go index 6545d1d5c..8fbddc968 100644 --- a/communicator/ssh/communicator.go +++ b/communicator/ssh/communicator.go @@ -335,7 +335,6 @@ func (c *comm) reconnect() (err error) { } if err != nil { - log.Printf("[ERROR] handshake error: %s", err) return } log.Printf("[DEBUG] handshake complete!")