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

Error on missing template variable #228

Open
banesullivan opened this issue Apr 4, 2022 · 3 comments
Open

Error on missing template variable #228

banesullivan opened this issue Apr 4, 2022 · 3 comments
Assignees

Comments

@banesullivan
Copy link
Contributor

banesullivan commented Apr 4, 2022

There is a fantastic blog post here on configuring Django to error when templates are missing variables in their context

I think we should incorporate one of the approaches for this at least in the development configuration as it is all too easy to misspell a variable and not notice it or deprecate a variable in the backend code that the SSR templates assume is still present.

Personally, I am in favor of the third approach in that blog: Logging Filter That Promotes Messages to Errors

This will log all missing variables as errors so that we can easily catch them in development and in production without erroring the entire page

@brianhelba
Copy link
Contributor

I agree the third approach is best.

I'd rather send them as WARNING, just because they are still technically non-fatal events (since we're not opting for "With a Logging Filter that Raises Exceptions"). The default logging settings will output WARNING-level messages right next to ERROR-level messages. For those using Sentry in production, it will also create an issue out of any warning-level messages too. Do you see any reason why we ought to insist on making these ERROR?

@banesullivan
Copy link
Contributor Author

If sentry catches warning level logs than that works for me!

@brianhelba
Copy link
Contributor

https://github.com/girder/django-composed-configuration/blob/master/composed_configuration/sentry/apps.py#L24

@brianhelba brianhelba transferred this issue from kitware-resonant/django-composed-configuration Jan 27, 2025
@danlamanna danlamanna self-assigned this Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

3 participants