diff options
Diffstat (limited to 'kilo/kilo/requests/views/subnet.py')
-rw-r--r-- | kilo/kilo/requests/views/subnet.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/kilo/kilo/requests/views/subnet.py b/kilo/kilo/requests/views/subnet.py index 3512a2f0..8dabafb1 100644 --- a/kilo/kilo/requests/views/subnet.py +++ b/kilo/kilo/requests/views/subnet.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 @@ -50,6 +50,9 @@ class Subnets(APIView): return Response(data=content, status=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)}, @@ -134,6 +137,9 @@ class Subnets(APIView): return Response(data=resp_body, 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)}, @@ -157,6 +163,9 @@ class Subnets(APIView): return Response(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)}, |