Use errdefs instead of string contains for checking not found
Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
parent
16a1736b9b
commit
9b62d4ffa3
|
@ -147,7 +147,7 @@ func (c *client) Restore(ctx context.Context, id string, attachStdio StdioCallba
|
||||||
rio, err = attachStdio(io)
|
rio, err = attachStdio(io)
|
||||||
return rio, err
|
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
|
return false, -1, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue