From b69f5f3257974adfddba449a38cea0d78922e7b8 Mon Sep 17 00:00:00 2001 From: Daniel Fuentes Date: Tue, 2 Dec 2025 16:14:36 -0600 Subject: [PATCH] await: directly check for context.Canceled errors: - Use a direct equality check to tell if a suboutine was ended due to a context.Canceled error. The old check using errors.Is() would falsely catch library errors that themselves wrap context.Canceled. In those cases, we should propogate the error instead of exiting cleanly. --- await/await.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/await/await.go b/await/await.go index 1be13ec..d776ffd 100644 --- a/await/await.go +++ b/await/await.go @@ -163,7 +163,7 @@ loop: cancel(fmt.Errorf("await: %w", err)) err = waitOrTimeout(r.stopTimeout, &waitCount, err) - if errors.Is(err, context.Canceled) { + if err == context.Canceled { return nil }