Add correct error handling for page data nodes #35751
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
![image](https://private-user-images.githubusercontent.com/970609/411702200-ac08731e-506d-4d91-8c61-0746f0050580.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzOTQyNjUsIm5iZiI6MTczOTM5Mzk2NSwicGF0aCI6Ii85NzA2MDkvNDExNzAyMjAwLWFjMDg3MzFlLTUwNmQtNGQ5MS04YzYxLTA3NDZmMDA1MDU4MC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjEyJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxMlQyMDU5MjVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0yNjgwZTEyYmJjZDdhMjZhODQyOGE5YWExNzU1Njg4NGJjYTEzNjEyMGIwNGQ2MDhiYzVkMGM0NGQ3NDIyYzI4JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.518V_LoJhpz0rv73MT3xVjgP28hHtoF1IO6Yfnku7oU)
origin
: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
andlineno
variables. The previous code cited the need to mock thetoken
, 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](https://private-user-images.githubusercontent.com/970609/411701571-8a0bf45c-15a9-4fc7-9d78-0669e78728de.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzOTQyNjUsIm5iZiI6MTczOTM5Mzk2NSwicGF0aCI6Ii85NzA2MDkvNDExNzAxNTcxLThhMGJmNDVjLTE1YTktNGZjNy05ZDc4LTA2NjllNzg3MjhkZS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjEyJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxMlQyMDU5MjVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1lY2E2NjhjYTgwMjM4ODNjOTBjNTMzNWNmYWNiZDFmODA3OTFkYjAwMWJhNTA0YzVjN2Q4NTQ5ODY5YTg1Yjg2JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.0Gz_IUYsgi8YONL5K_3TqPMTyX0bmgAm6ibvCX-VkgA)
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 whenDEBUG
is on. From the Django Node code, there is no exception processing unlesscontext.template.engine.debug
isTrue
. 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
Labels & Review