﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
31778	Pass exception to ERROR_PAGE_TEMPLATE after catching TemplateDoesNotExist.	Rico Rodriguez	nobody	"Let's take the example of `django.views.defaults.permission_denied`, which reads as such:

{{{#!python
@requires_csrf_token
def permission_denied(request, exception, template_name=ERROR_403_TEMPLATE_NAME):
    """"""
    Permission denied (403) handler.

    Templates: :template:`403.html`
    Context: None

    If the template does not exist, an Http403 response containing the text
    ""403 Forbidden"" (as per RFC 7231) will be returned.
    """"""
    try:
        template = loader.get_template(template_name)
    except TemplateDoesNotExist:
        if template_name != ERROR_403_TEMPLATE_NAME:
            # Reraise if it's a missing custom template.
            raise
        return HttpResponseForbidden(
            ERROR_PAGE_TEMPLATE % {'title': '403 Forbidden', 'details': ''},
            content_type='text/html',
        )
    return HttpResponseForbidden(
        template.render(request=request, context={'exception': str(exception)})
    )
}}}

In the case where I raise something like `PermissionDenied(""Some message"")`, it would be nice if `""Some message""` got passed into `ERROR_PAGE_TEMPLATE` as the `'details'`.

You can see that pretty much every other default view (with the exception of `page_not_found`, which already passes something in ""details"") would stand to improve from a similar change."	New feature	closed	HTTP handling	3.0	Normal	wontfix		Claude Paroz	Unreviewed	0	0	0	0	0	0
