mirror of
https://github.com/containers/podman.git
synced 2025-10-17 19:24:04 +08:00
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>
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user