jointakahe / takahe

An ActivityPub/Fediverse server
BSD 3-Clause "New" or "Revised" License
1.12k stars 86 forks source link

500 template rendering errors masking underlying exceptoins #582

Closed chdorner closed 1 year ago

chdorner commented 1 year ago

Been going through a whole bunch of Sentry errors recently and our 500 templates can't be rendered properly if an exception happens in the view code. In this case the template is rendered without a context, but the base.html refers to config in multiple places. So the root exception is masked behind a fairly large stack trace beginning with: VariableDoesNotExist: Failed lookup for key [config] in [{'True': True, 'False': False, 'None': None}].

Should we get create a new bare-bones base template for 500 errors where we just statically render everything without trying to name or style the page based on the various configurations?

andrewgodwin commented 1 year ago

Yes, this used to be what base_plain was for until I overrode it with stuff for the about pages. A single template with no calls to variables at all is probably best.

andrewgodwin commented 1 year ago

I switched this out just before the 0.9 release so it's now a very plain template indeed.