Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Folded BaseHandler.get_technical_error_response() into BaseHandler.ge…

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

git-svn-id: http://code.djangoproject.com/svn/django/trunk@3879 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit c0127f015bc8ba78ac616e97f803b19f6027bb12 1 parent f22cd4e
@adrianholovaty adrianholovaty authored
Showing with 4 additions and 13 deletions.
  1. +4 −13 django/core/handlers/base.py
View
17 django/core/handlers/base.py
@@ -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)
else:
callback, param_dict = resolver.resolve404()
return callback(request, **param_dict)
@@ -99,7 +100,8 @@ def get_response(self, request):
pass # See http://code.djangoproject.com/ticket/1023
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())
else:
# 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
Please sign in to comment.
Something went wrong with that request. Please try again.