Merge pull request #6253 from hashicorp/fix6252

show error message when -on-error=[ask|abort]
pull/6259/head
Matthew Hooker 8 years ago committed by GitHub
commit a10172c37c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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

@ -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!")

Loading…
Cancel
Save