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.
@@ -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)
