Merge "Fix dashboard's error handling on production servers."

This commit is contained in:
Jenkins 2013-10-04 15:03:38 +00:00 committed by Gerrit Code Review
commit 5df8ceff59
1 changed files with 4 additions and 2 deletions

View File

@ -5,6 +5,7 @@ import sys
from django.http import HttpResponseServerError
from openstack_dashboard import exceptions
from muranoclient.common import exceptions as muranoclient
from horizon.middleware import HorizonMiddleware
ROOT_PATH = os.path.dirname(os.path.abspath(__file__))
BIN_DIR = os.path.abspath(os.path.join(ROOT_PATH, '..', 'bin'))
@ -69,10 +70,11 @@ HORIZON_CONFIG = {
logger = logging.getLogger(__name__)
class ExceptionMiddleware(object):
class ExceptionMiddleware(HorizonMiddleware):
def process_exception(self, request, exception):
logger.error(traceback.format_exc())
return HttpResponseServerError()
return super(ExceptionMiddleware, self).process_exception(
request, exception)
MIDDLEWARE_CLASSES = (