Merge pull request #6253 from hashicorp/fix6252
show error message when -on-error=[ask|abort]
This commit is contained in:
commit
a10172c37c
|
@ -71,6 +71,10 @@ func (s abortStep) Run(ctx context.Context, state multistep.StateBag) multistep.
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s abortStep) Cleanup(state multistep.StateBag) {
|
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 {
|
if _, ok := state.GetOk(multistep.StateCancelled); ok {
|
||||||
s.ui.Error("Interrupted, aborting...")
|
s.ui.Error("Interrupted, aborting...")
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
@ -99,6 +103,11 @@ func (s askStep) Run(ctx context.Context, state multistep.StateBag) (action mult
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err, ok := state.GetOk("error")
|
||||||
|
if ok {
|
||||||
|
s.ui.Error(fmt.Sprintf("%s", err))
|
||||||
|
}
|
||||||
|
|
||||||
switch ask(s.ui, typeName(s.step), state) {
|
switch ask(s.ui, typeName(s.step), state) {
|
||||||
case askCleanup:
|
case askCleanup:
|
||||||
return
|
return
|
||||||
|
|
|
@ -335,7 +335,6 @@ func (c *comm) reconnect() (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("[ERROR] handshake error: %s", err)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
log.Printf("[DEBUG] handshake complete!")
|
log.Printf("[DEBUG] handshake complete!")
|
||||||
|
|
Loading…
Reference in New Issue