mirror of
https://github.com/containers/podman.git
synced 2025-08-06 03:19:52 +08:00
Print error status code if we fail to parse it
When we read the conmon error status file, if Atoi fails to parse the string we read from the file as an int, print the string as part of the error message so we know what might have gone wrong. Signed-off-by: Matthew Heon <mheon@redhat.com>
This commit is contained in:

committed by
Matthew Heon

parent
c9e9ca5671
commit
536af1f689
@ -206,8 +206,8 @@ func (c *Container) handleExitFile(exitFile string, fi os.FileInfo) error {
|
||||
}
|
||||
statusCode, err := strconv.Atoi(string(statusCodeStr))
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "error converting exit status code for container %s to int",
|
||||
c.ID())
|
||||
return errors.Wrapf(err, "error converting exit status code (%q) for container %s to int",
|
||||
c.ID(), statusCodeStr)
|
||||
}
|
||||
c.state.ExitCode = int32(statusCode)
|
||||
|
||||
|
Reference in New Issue
Block a user