Merge pull request #35959 from dnephin/remove-str-error-checking

Use errdefs instead of string contains for checking not found
This commit is contained in:
Brian Goff 2018-01-08 20:33:51 -05:00 committed by GitHub
commit 7f6fdce901
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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
}