Skip to content

Ignore not-found errors in Sentry - #3602

Merged
thecristen merged 2 commits into
mainfrom
thecristen/ignore-not-found-sentry-errors
Oct 21, 2026
Merged

thecristen merged 2 commits into
mainfrom
thecristen/ignore-not-found-sentry-errors

Conversation

@thecristen

@thecristen thecristen commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Exclude DotcomWeb.NotFoundError from Sentry reporting because the router renders it as a normal 404 response.
  • Add focused coverage for excluding not-found errors while keeping unexpected errors reportable.

References

Validation

  • mix test test/dotcom/sentry_test.exs — not run: dependencies are unavailable in this checkout.
  • mix format --check-formatted lib/sentry.ex test/dotcom/sentry_test.exs — not run: Phoenix dependency is unavailable in this checkout.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@lvachon1

Copy link
Copy Markdown
Contributor

I am unable to get the new test to run using the steps provided:

== Compilation error in file test/dotcom/sentry_test.exs ==
** (ArgumentError) the following keys must also be given when building struct Sentry.Event: [:event_id, :timestamp]
    (sentry 13.5.1) expanding struct: Sentry.Event.__struct__/1
    test/dotcom/sentry_test.exs:6: Dotcom.SentryTest."test before_send/1 ignores not found errors"/1

The other changes look fine to me.

@joshlarson joshlarson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Echoing Luc's comment, the new test causes the build to fail.

Other Sentry exclusions aren't tested, and I'm not 100% convinced that we need this one to be either.

@thecristen
thecristen enabled auto-merge (squash) October 19, 2026 16:38
@thecristen
thecristen requested a review from joshlarson October 19, 2026 16:39
@thecristen
thecristen merged commit 7a4f15c into main Oct 21, 2026
29 checks passed
@thecristen
thecristen deleted the thecristen/ignore-not-found-sentry-errors branch October 21, 2026 20:02
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.

3 participants