diff --git a/background_check.go b/background_check.go index c86602e68..2458ad6ed 100644 --- a/background_check.go +++ b/background_check.go @@ -3,11 +3,16 @@ package main import ( + "fmt" + "github.com/shirou/gopsutil/process" ) func checkProcess(currentPID int) (bool, error) { - myProc, _ := process.NewProcess(int32(currentPID)) + myProc, err := process.NewProcess(int32(currentPID)) + if err != nil { + return false, fmt.Errorf("Error figuring out Packer process info") + } bg, _ := myProc.Background() return bg, nil