This commit is contained in:
Piotr Mitros
2012-01-30 15:53:57 -05:00

View File

@@ -1,5 +1,6 @@
import logging
from django.conf import settings
from django.http import HttpResponse
log = logging.getLogger("mitx")
@@ -8,6 +9,7 @@ class ExceptionLoggingMiddleware(object):
"""Just here to log unchecked exceptions that go all the way up the Django
stack"""
def process_exception(self, request, exception):
log.exception(exception)
return HttpResponse("Server Error - Please try again later.")
if not settings.TEMPLATE_DEBUG:
def process_exception(self, request, exception):
log.exception(exception)
return HttpResponse("Server Error - Please try again later.")