Use errdefs instead of string contains for checking not found

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 9b62d4ffa39f7c042f94f9a3670cae2a816535da
Component: engine
This commit is contained in:
Daniel Nephin
2018-01-08 14:32:39 -05:00
parent 5017f2840c
commit 88fc146546
@@ -147,7 +147,7 @@ func (c *client) Restore(ctx context.Context, id string, attachStdio StdioCallba
rio, err = attachStdio(io)
return rio, err
})
if err != nil && !strings.Contains(err.Error(), "no running task found") {
if err != nil && !errdefs.IsNotFound(errors.Cause(err)) {
return false, -1, err
}