diff options
author | Bin Yang <bin.yang@windriver.com> | 2017-03-28 14:54:38 +0800 |
---|---|---|
committer | Bin Yang <bin.yang@windriver.com> | 2017-03-28 14:54:38 +0800 |
commit | 8d0ec8dcd8095f48db0912742cca96461e90bf06 (patch) | |
tree | ac82cef516e257fa828bbe009474ab125cebdb0b /kilo/kilo/requests/views/tenants.py | |
parent | ca20093c544d7ec5ce9e5efe8003576a4ce2e23c (diff) |
Expose detail information upon API call failure
Change-Id: I6e42cebeb7e1c5edd3f77b8c0c6c091d04fcb364
Issue-Id: MULTIVIM-58
Signed-off-by: Bin Yang <bin.yang@windriver.com>
Diffstat (limited to 'kilo/kilo/requests/views/tenants.py')
-rw-r--r-- | kilo/kilo/requests/views/tenants.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/kilo/kilo/requests/views/tenants.py b/kilo/kilo/requests/views/tenants.py index c8a7fff2..31b17a0b 100644 --- a/kilo/kilo/requests/views/tenants.py +++ b/kilo/kilo/requests/views/tenants.py @@ -14,7 +14,7 @@ import logging import json import traceback - +from keystoneauth1.exceptions import HttpError from rest_framework import status from rest_framework.response import Response from rest_framework.views import APIView @@ -70,6 +70,9 @@ class Tenants(APIView): return Response(data=content, status=resp.status_code) except VimDriverKiloException as e: return Response(data={'error': e.content}, status=e.status_code) + except HttpError as e: + logger.error("HttpError: status:%s, response:%s" % (e.http_status, e.response.json())) + return Response(data=e.response.json(), status=e.http_status) except Exception as e: logger.error(traceback.format_exc()) return Response(data={'error': str(e)}, |