Skip to content

Ignore not-found errors in Sentry - #3602

Open
thecristen wants to merge 1 commit into
mainfrom
thecristen/ignore-not-found-sentry-errors
Open

thecristen wants to merge 1 commit 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.

This branch has not been deployed

No deployments
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