Skip to content

Fix Sentry error reporting#7

Merged
retlehs merged 1 commit intomainfrom
fix/sentry-error-reporting
Mar 15, 2026
Merged

Fix Sentry error reporting#7
retlehs merged 1 commit intomainfrom
fix/sentry-error-reporting

Conversation

@retlehs
Copy link
Member

@retlehs retlehs commented Mar 15, 2026

Summary

  • Swap Recoverer/sentryhttp middleware order so Sentry catches panics before Recoverer swallows them (also fixes "superfluous WriteHeader" log spam)
  • Add captureError() helper using request-scoped Sentry hub at all handled error paths (handlers, SEO, admin auth, template render)
  • Capture server startup/shutdown errors directly via sentry.CaptureException

Test plan

  • go build ./... passes
  • go vet ./internal/http/... clean
  • golangci-lint run ./internal/http/... — 0 issues
  • make test — all tests pass
  • Deploy and verify errors appear in Sentry dashboard
  • Verify "superfluous WriteHeader" log spam is gone

🤖 Generated with Claude Code

Swap Recoverer/sentryhttp middleware order so Sentry sees panics before
Recoverer swallows them. Add captureError() calls at all handled error
paths so non-panic errors reach Sentry with request context. Capture
server startup/shutdown errors directly. Pass *http.Request through
render() for request-scoped Sentry hub metadata.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@retlehs retlehs merged commit d22a644 into main Mar 15, 2026
6 checks passed
@retlehs retlehs deleted the fix/sentry-error-reporting branch March 15, 2026 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant