summaryrefslogtreecommitdiff
path: root/libpod/container_api.go
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2019-06-17 10:55:54 +0200
committerValentin Rothberg <rothberg@redhat.com>2019-06-17 10:55:54 +0200
commit0f75410e1cb93275e3d4f45f849f9c83b3955daf (patch)
tree641d4187fee154c860cafd744c50d52c67f02623 /libpod/container_api.go
parent1322b41aa09d9cd9c4a51a7b69ff0e92df37a90b (diff)
downloadpodman-0f75410e1cb93275e3d4f45f849f9c83b3955daf.tar.gz
podman-0f75410e1cb93275e3d4f45f849f9c83b3955daf.tar.bz2
podman-0f75410e1cb93275e3d4f45f849f9c83b3955daf.zip
kill: print ID and state for non-running containers
Extend kill's error message to include the container's ID and state. This address cases where error messages caused by other containers may confuse users. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'libpod/container_api.go')
-rw-r--r--libpod/container_api.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/libpod/container_api.go b/libpod/container_api.go
index 52d3afc0a..83500bc47 100644
--- a/libpod/container_api.go
+++ b/libpod/container_api.go
@@ -203,7 +203,7 @@ func (c *Container) Kill(signal uint) error {
}
if c.state.State != ContainerStateRunning {
- return errors.Wrapf(ErrCtrStateInvalid, "can only kill running containers")
+ return errors.Wrapf(ErrCtrStateInvalid, "can only kill running containers. %s in state %s", c.ID(), c.state.State.String())
}
defer c.newContainerEvent(events.Kill)