Browse Source

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
jiaopengju 5 months ago
parent
commit
b5834a701f
1 changed files with 1 additions and 0 deletions
  1. 1
    0
      karbor/api/middleware/fault.py

+ 1
- 0
karbor/api/middleware/fault.py View File

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

Loading…
Cancel
Save