﻿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
23002	handle_uncaught_exception: add support for debug=True kwarg / factor request.error logging out	Daniel Hahler	nobody	"It would be useful if you could call `handle_uncaught_exception` with `debug=True` explicitly (which would default to `settings.DEBUG`).


Additionally, the he logging part in `handle_uncaught_exception` could be moved into a separate function:

{{{
        logger.error('Internal Server Error: %s', request.path,
            exc_info=exc_info,
            extra={
                'status_code': 500,
                'request': request
            }
        )
}}}
(Source: https://github.com/django/django/blob/master/django/core/handlers/base.py#L232-238)

This would make it easier to provide consistent behavior with e.g. middlewares that want to provide `technical_500_response` (e.g. ""Technical 500 by group membership"", https://djangosnippets.org/snippets/1719/#c5852).

While they could copy the code to call the `logger`, it seems to be better having a consistent method that can be called.


The following code might work just as well, but is more likely to break (and changing `settings` in the code should not get done IIRC):

{{{
def get_technical_500_response_with_debug():
    from django.conf import settings
    debug_orig = settings.DEBUG
    settings.DEBUG = True
    r = technical_500_response(request, *exc_info)
    settings.DEBUG = debug_orig
    return r
}}}"	Cleanup/optimization	closed	Core (Other)	dev	Normal	wontfix			Unreviewed	0	0	0	0	0	0
