mirror of
https://github.com/containers/podman.git
synced 2025-10-19 20:23:08 +08:00
Make error messages more descriptive
Recently was trying to start podman machine with krunkit and got: Error: krunkit exited unexpectedly with exit code 1 which isn't very descriptive. Although this doesn't solve the issue, it increases the debugability of this error. Signed-off-by: Eric Curtin <ecurtin@redhat.com>
This commit is contained in:
@ -360,8 +360,14 @@ func CheckProcessRunning(processName string, pid int) error {
|
|||||||
return fmt.Errorf("failed to read %s process status: %w", processName, err)
|
return fmt.Errorf("failed to read %s process status: %w", processName, err)
|
||||||
}
|
}
|
||||||
if pid > 0 {
|
if pid > 0 {
|
||||||
// child exited
|
// Child exited, process is no longer running
|
||||||
return fmt.Errorf("%s exited unexpectedly with exit code %d", processName, status.ExitStatus())
|
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
|
return nil
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user