Fix dashboard's error handling on production servers.
Change-Id: Id1d1077be000cf0d5ae950f4fb7c5e1ae35bc488 Closes-bug: MRN-1124
This commit is contained in:
parent
356474031d
commit
e10500da69
|
@ -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 = (
|
||||
|
|
Loading…
Reference in New Issue