Skip to content

Don't allow error pages to raise errors #35216

Description

@timmc-edx

The generic error views for 403, 404, and 500 can themselves raise exceptions, resulting in users not having intelligible error pages and making it harder for service operators to understand what is happening.

See #35151 for some past fallout of these problems. Note in particular that bad translations can cause error pages to raise exceptions at any time.

Acceptance criteria:

  • Each of the static template views in lms/djangoapps/static_template_view/views.py that manages some kind of error condition must have a try/except and a fallback to a hardcoded string. No DB calls, translations, etc. in the hardcoded value.
  • In each place where an error template has logic that makes DB calls, relies on user/session information, translations, etc., there is a try/except that can substitute in an acceptable fallback value.
  • Optionally: Mark the current span as having an error, using record_exception from edx-django-utils

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions