diff options
author | Matthew Heon <mheon@redhat.com> | 2018-10-29 13:20:26 -0400 |
---|---|---|
committer | Matthew Heon <matthew.heon@gmail.com> | 2018-11-07 11:36:01 -0500 |
commit | 536af1f68944c68956e705d589e11cd52875273a (patch) | |
tree | a696d9e179d5410c21ed1c1813589ad447e24023 | |
parent | c9e9ca5671775652b2e097641713084ea367a7fa (diff) | |
download | podman-536af1f68944c68956e705d589e11cd52875273a.tar.gz podman-536af1f68944c68956e705d589e11cd52875273a.tar.bz2 podman-536af1f68944c68956e705d589e11cd52875273a.zip |
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>
-rw-r--r-- | libpod/container_internal.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go index 5221ac5b6..54558f3fc 100644 --- a/libpod/container_internal.go +++ b/libpod/container_internal.go @@ -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) |