Skip to content

Commit

Permalink
Merge pull request #24257 from ericcurtin/CheckProcessRunning-debug
Browse files Browse the repository at this point in the history
Make error messages more descriptive
  • Loading branch information
openshift-merge-bot[bot] authored Oct 14, 2024
2 parents 0894cec + 94dcf76 commit 92666f2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkg/machine/apple/apple.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,14 @@ func CheckProcessRunning(processName string, pid int) error {
return fmt.Errorf("failed to read %s process status: %w", processName, err)
}
if pid > 0 {
// child exited
return fmt.Errorf("%s exited unexpectedly with exit code %d", processName, status.ExitStatus())
// Child exited, process is no longer running
if status.Exited() {
return fmt.Errorf("%s exited unexpectedly with exit code %d", processName, status.ExitStatus())
}
if status.Signaled() {
return fmt.Errorf("%s was terminated by signal: %s", processName, status.Signal().String())
}
return fmt.Errorf("%s exited unexpectedly", processName)
}
return nil
}
Expand Down

1 comment on commit 92666f2

@packit-as-a-service
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

podman-next COPR build failed. @containers/packit-build please check.

Please sign in to comment.