You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
packer/common/check_run_status.go

25 lines
519 B

package common
import (
"github.com/mitchellh/multistep"
"errors"
)
func CheckRunStatus(state *multistep.BasicStateBag) error {
// If there was an error, return that
if rawErr, ok := state.GetOk("error"); ok {
return rawErr.(error)
}
// If we were interrupted or cancelled, then just exit.
if _, ok := state.GetOk(multistep.StateCancelled); ok {
return errors.New("Build was cancelled.")
}
if _, ok := state.GetOk(multistep.StateHalted); ok {
return errors.New("Build was halted.")
}
return nil
}