Merge pull request #6027 from alakesh/log-fix

add current process state to the error message
This commit is contained in:
Derek McGowan 2021-09-21 14:35:33 -07:00 committed by GitHub
commit f6c1e7ed8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -210,7 +210,7 @@ func (p *process) Delete(ctx context.Context, opts ...ProcessDeleteOpts) (*ExitS
} }
switch status.Status { switch status.Status {
case Running, Paused, Pausing: 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{ r, err := p.task.client.TaskService().DeleteProcess(ctx, &tasks.DeleteProcessRequest{
ContainerID: p.task.id, ContainerID: p.task.id,