Add error log message in FaltWrapper

After installing karbor from source code, with executing
karbor related command, for example 'karbor service-list',
it returns 500 with 'The server has either erred or is
incapable of performing the requested operation. (HTTP 500)'.
In karbor api log, we can not find any useful word to point
out where the error occurs. So we should add error message
in FaltWrapper to record the error reason.

Closes-Bug: #1801920

Change-Id: I3e7e00d8a48d5cea38d4fb1ca0e62d558598bf6d
This commit is contained in:
jiaopengju 2018-11-06 20:00:14 +08:00 committed by Jiao Pengju
parent 9a13d3c9a2
commit b5834a701f
1 changed files with 1 additions and 0 deletions

View File

@ -39,6 +39,7 @@ class FaultWrapper(base_wsgi.Middleware):
status, webob.exc.HTTPInternalServerError)()
def _error(self, inner, req):
LOG.error('Middleware error occurred: %s', inner.message)
safe = getattr(inner, 'safe', False)
headers = getattr(inner, 'headers', None)
status = getattr(inner, 'code', http_client.INTERNAL_SERVER_ERROR)