diff options
author | Matthew Heon <matthew.heon@pm.me> | 2019-05-02 11:37:59 -0400 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2019-05-02 13:13:32 -0400 |
commit | 1e6413e3fde448d3b44fc36fd966d8d57af811f5 (patch) | |
tree | 663cab416c98703634479ee34dff005942b8ea76 /pkg/varlinkapi | |
parent | 0b2c9c2acc38f51f871fd5a06aca205127a06d1d (diff) | |
download | podman-1e6413e3fde448d3b44fc36fd966d8d57af811f5.tar.gz podman-1e6413e3fde448d3b44fc36fd966d8d57af811f5.tar.bz2 podman-1e6413e3fde448d3b44fc36fd966d8d57af811f5.zip |
Add an InvalidState varlink error for Init
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'pkg/varlinkapi')
-rw-r--r-- | pkg/varlinkapi/containers.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/pkg/varlinkapi/containers.go b/pkg/varlinkapi/containers.go index 861e3210b..c8be41636 100644 --- a/pkg/varlinkapi/containers.go +++ b/pkg/varlinkapi/containers.go @@ -372,6 +372,9 @@ func (i *LibpodAPI) InitContainer(call iopodman.VarlinkCall, name string) error return call.ReplyContainerNotFound(name, err.Error()) } if err := ctr.Init(getContext()); err != nil { + if errors.Cause(err) == libpod.ErrCtrStateInvalid { + return call.ReplyInvalidState(ctr.ID(), err.Error()) + } return call.ReplyErrorOccurred(err.Error()) } return call.ReplyInitContainer(ctr.ID()) |