Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add correct error handling for page data nodes #35751

Merged
merged 1 commit into from
Feb 11, 2025

Conversation

mjriley
Copy link
Contributor

@mjriley mjriley commented Feb 10, 2025

Technical Summary

While debugging the domain analytics issue, I noticed that the error wasn't being displayed properly in my local environment. Rather than correctly point to the missing domain property, I was instead seeing an error about origin:
image

I was able to add in an origin property to mimic what was being done in the Django source

However, I then realized that it would always attribute the error as occuring on the first line for unrelated code, due to incorrect position and lineno variables. The previous code cited the need to mock the token, but I believe that was due to the absence of a token causing errors. I think we should be using the real token, in order to get fully correct error information.

Once fixed, the error output aligns with normal Django expectations:
image

Feature Flag

No feature flag

Safety Assurance

Safety story

Verified this locally. I believe the reason we needed to fake the token was due to render_annotated's behavior when DEBUG is on. From the Django Node code, there is no exception processing unless context.template.engine.debug is True. Given that production does not run in debug mode, this change should only affect local machines.

Automated test coverage

No tests

QA Plan

No QA

Rollback instructions

  • This PR can be reverted after deploy with no further considerations

Labels & Review

  • Risk label is set correctly
  • The set of people pinged as reviewers is appropriate for the level of risk of the change

Copy link
Contributor

@millerdev millerdev left a comment

Choose a reason for hiding this comment

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

🔎 🐛

@mjriley mjriley merged commit 45774a4 into master Feb 11, 2025
14 checks passed
@mjriley mjriley deleted the mjr/page-data-attribution branch February 11, 2025 14:59
@biyeun
Copy link
Member

biyeun commented Feb 11, 2025

i believe this is causing a lot of noise when running locally...not sure if that will be a problem on production and clogging up our sentry log limits

@mjriley
Copy link
Contributor Author

mjriley commented Feb 11, 2025

i believe this is causing a lot of noise when running locally...not sure if that will be a problem on production and clogging up our sentry log limits

Confirmed that the issues seen are unrelated to this PR

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.

4 participants