Fix dashboard's error handling on production servers.

Change-Id: Id1d1077be000cf0d5ae950f4fb7c5e1ae35bc488
Closes-bug: MRN-1124
This commit is contained in:
Timur Sufiev 2013-10-04 15:26:20 +04:00
parent 356474031d
commit e10500da69
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 = (