Browse code

Use errdefs instead of string contains for checking not found

Signed-off-by: Daniel Nephin <dnephin@docker.com>

Daniel Nephin authored on 2018/01/09 04:32:39
Showing 1 changed files
... ...
@@ -147,7 +147,7 @@ func (c *client) Restore(ctx context.Context, id string, attachStdio StdioCallba
147 147
 		rio, err = attachStdio(io)
148 148
 		return rio, err
149 149
 	})
150
-	if err != nil && !strings.Contains(err.Error(), "no running task found") {
150
+	if err != nil && !errdefs.IsNotFound(errors.Cause(err)) {
151 151
 		return false, -1, err
152 152
 	}
153 153