From c0127f015bc8ba78ac616e97f803b19f6027bb12 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Thu, 28 Sep 2006 02:37:41 +0000 Subject: [PATCH] Folded BaseHandler.get_technical_error_response() into BaseHandler.get_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 --- django/core/handlers/base.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/django/core/handlers/base.py b/django/core/handlers/base.py index f9a948d186..213c528952 100644 --- a/django/core/handlers/base.py +++ b/django/core/handlers/base.py @@ -89,7 +89,8 @@ class BaseHandler(object): 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 @@ class BaseHandler(object): 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 @@ class BaseHandler(object): 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