From 1e6413e3fde448d3b44fc36fd966d8d57af811f5 Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Thu, 2 May 2019 11:37:59 -0400 Subject: Add an InvalidState varlink error for Init Signed-off-by: Matthew Heon --- pkg/varlinkapi/containers.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pkg/varlinkapi') 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()) -- cgit v1.2.3-54-g00ecf