Files
edx-platform/util/middleware.py
David Ormsbee 18fe892f4f have our catch-all exception handling push a 500 error
--HG--
branch : AB Testing
2012-02-07 14:39:43 -05:00

16 lines
482 B
Python

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