Skip to content
Browse files

Folded BaseHandler.get_technical_error_response() into…

…t_response() to save the overhead of a function call, and because that logic didn't need to be abstracted.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent f22cd4e commit c0127f015bc8ba78ac616e97f803b19f6027bb12 @adrianholovaty adrianholovaty committed
Showing with 4 additions and 13 deletions.
  1. +4 −13 django/core/handlers/
17 django/core/handlers/
@@ -89,7 +89,8 @@ def get_response(self, request):
return response
except http.Http404, e:
if settings.DEBUG:
- return self.get_technical_error_response(request, is404=True, exception=e)
+ from django.views import debug
+ return debug.technical_404_response(request, e)
callback, param_dict = resolver.resolve404()
return callback(request, **param_dict)
@@ -99,7 +100,8 @@ def get_response(self, request):
pass # See
except: # Handle everything else, including SuspiciousOperation, etc.
if settings.DEBUG:
- return self.get_technical_error_response(request)
+ from django.views import debug
+ return debug.technical_500_response(request, *sys.exc_info())
# Get the exception info now, in case another exception is thrown later.
exc_info = sys.exc_info()
@@ -116,17 +118,6 @@ def get_response(self, request):
callback, param_dict = resolver.resolve500()
return callback(request, **param_dict)
- def get_technical_error_response(self, request, is404=False, exception=None):
- """
- Returns an HttpResponse that displays a TECHNICAL error message for a
- fundamental error.
- """
- from django.views import debug
- if is404:
- return debug.technical_404_response(request, exception)
- else:
- return debug.technical_500_response(request, *sys.exc_info())
def _get_traceback(self, exc_info=None):
"Helper function to return the traceback as a string"
import traceback

0 comments on commit c0127f0

Please sign in to comment.
Something went wrong with that request. Please try again.