summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjiaopengju <jiaopengju@cmss.chinamobile.com>2018-11-06 20:00:14 +0800
committerJiao Pengju <jiaopengju@cmss.chinamobile.com>2018-11-07 09:40:03 +0000
commitb5834a701f82fe92863021e4f260aeb8c812fa5d (patch)
tree70b06751f6f4802186ab457b8408da6dfeced83a
parent9a13d3c9a20440a7011ca3e332b17db1bcfd6026 (diff)
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
Notes
Notes (review): Code-Review+2: Jiao Pengju <jiaopengju@cmss.chinamobile.com> Workflow+1: Jiao Pengju <jiaopengju@cmss.chinamobile.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Wed, 07 Nov 2018 11:30:39 +0000 Reviewed-on: https://review.openstack.org/615848 Project: openstack/karbor Branch: refs/heads/master
-rw-r--r--karbor/api/middleware/fault.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/karbor/api/middleware/fault.py b/karbor/api/middleware/fault.py
index 90568a4..a96a9f4 100644
--- a/karbor/api/middleware/fault.py
+++ b/karbor/api/middleware/fault.py
@@ -39,6 +39,7 @@ class FaultWrapper(base_wsgi.Middleware):
39 status, webob.exc.HTTPInternalServerError)() 39 status, webob.exc.HTTPInternalServerError)()
40 40
41 def _error(self, inner, req): 41 def _error(self, inner, req):
42 LOG.error('Middleware error occurred: %s', inner.message)
42 safe = getattr(inner, 'safe', False) 43 safe = getattr(inner, 'safe', False)
43 headers = getattr(inner, 'headers', None) 44 headers = getattr(inner, 'headers', None)
44 status = getattr(inner, 'code', http_client.INTERNAL_SERVER_ERROR) 45 status = getattr(inner, 'code', http_client.INTERNAL_SERVER_ERROR)