Skip to content

Commit c1a9bdb

Browse files
authored
Merge pull request moby#4587 from jedevc/use-errors-is
solver: use errors.Is when checking context.Cause()
2 parents a2f9383 + 51aca40 commit c1a9bdb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

solver/errdefs/context.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ func IsCanceled(ctx context.Context, err error) bool {
1414
return true
1515
}
1616
// grpc does not set cancel correctly when stream gets cancelled and then Recv is called
17-
if err != nil && context.Cause(ctx) == context.Canceled {
17+
if err != nil && errors.Is(context.Cause(ctx), context.Canceled) {
1818
// when this error comes from containerd it is not typed at all, just concatenated string
1919
if strings.Contains(err.Error(), "EOF") {
2020
return true

0 commit comments

Comments
 (0)