소스 검색

Use errdefs instead of string contains for checking not found

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Daniel Nephin 7 년 전
부모
커밋
9b62d4ffa3
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      libcontainerd/client_daemon.go

+ 1 - 1
libcontainerd/client_daemon.go

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