From 16f3d67b5a804b3a32a5df6318531768a654ef8c Mon Sep 17 00:00:00 2001 From: Alakesh Haloi Date: Fri, 17 Sep 2021 16:46:57 -0700 Subject: [PATCH] add current process state to the error message It will aid debugging if a procees delete fails, to figure out whether it is paused or running. Signed-off-by: Alakesh Haloi --- process.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/process.go b/process.go index 5b302569b..fb17a48c0 100644 --- a/process.go +++ b/process.go @@ -210,7 +210,7 @@ func (p *process) Delete(ctx context.Context, opts ...ProcessDeleteOpts) (*ExitS } switch status.Status { case Running, Paused, Pausing: - return nil, errors.Wrapf(errdefs.ErrFailedPrecondition, "process must be stopped before deletion") + return nil, errors.Wrapf(errdefs.ErrFailedPrecondition, "current process state: %s, process must be stopped before deletion", status.Status) } r, err := p.task.client.TaskService().DeleteProcess(ctx, &tasks.DeleteProcessRequest{ ContainerID: p.task.id,