Skip to content

Commit 53d7fed

Browse files
retlehsclaude
andauthored
Skip Sentry reporting for context cancellation errors (#32)
Fixes WP-COMPOSER-4 Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f0b3082 commit 53d7fed

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

internal/http/handlers.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,12 @@ import (
3030
const perPage = 12
3131

3232
// captureError reports a non-panic error to Sentry with the request's hub.
33+
// It silently ignores context cancellation errors (timeouts, client disconnects)
34+
// since these are expected during normal operation.
3335
func captureError(r *http.Request, err error) {
36+
if r.Context().Err() != nil {
37+
return
38+
}
3439
if hub := sentry.GetHubFromContext(r.Context()); hub != nil {
3540
hub.CaptureException(err)
3641
} else {

0 commit comments

Comments
 (0)