summaryrefslogtreecommitdiff
path: root/django/core
diff options
context:
space:
mode:
authorAdam Johnson <me@adamj.eu>2022-01-12 12:04:14 +0000
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-01-12 20:23:42 +0100
commit90cf96326432df56a1cf981df215b83f4e993bfd (patch)
tree8c945fee178c3c183e4e04dc6a0bf94fde05b389 /django/core
parentd05ab13c56849ed09d02c1f188b7f47f0c090a2a (diff)
Changed django.utils.log.log_response() to take exception instance.
There's little point retrieving a fresh reference to the exception in the legacy tuple format, when it's all available via the exception instance we already have.
Diffstat (limited to 'django/core')
-rw-r--r--django/core/handlers/exception.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/django/core/handlers/exception.py b/django/core/handlers/exception.py
index 8b40f92005..5470b3dd53 100644
--- a/django/core/handlers/exception.py
+++ b/django/core/handlers/exception.py
@@ -64,7 +64,7 @@ def response_for_exception(request, exc):
'Forbidden (Permission denied): %s', request.path,
response=response,
request=request,
- exc_info=sys.exc_info(),
+ exception=exc,
)
elif isinstance(exc, MultiPartParserError):
@@ -73,7 +73,7 @@ def response_for_exception(request, exc):
'Bad request (Unable to parse request body): %s', request.path,
response=response,
request=request,
- exc_info=sys.exc_info(),
+ exception=exc,
)
elif isinstance(exc, BadRequest):
@@ -85,7 +85,7 @@ def response_for_exception(request, exc):
'%s: %s', str(exc), request.path,
response=response,
request=request,
- exc_info=sys.exc_info(),
+ exception=exc,
)
elif isinstance(exc, SuspiciousOperation):
if isinstance(exc, (RequestDataTooBig, TooManyFieldsSent)):
@@ -113,7 +113,7 @@ def response_for_exception(request, exc):
'%s: %s', response.reason_phrase, request.path,
response=response,
request=request,
- exc_info=sys.exc_info(),
+ exception=exc,
)
# Force a TemplateResponse to be rendered.