diff --git a/monascaclient/exc.py b/monascaclient/exc.py index 5a2e709..cf4f87c 100644 --- a/monascaclient/exc.py +++ b/monascaclient/exc.py @@ -1,4 +1,4 @@ -# (C) Copyright 2014-2016 Hewlett Packard Enterprise Development Company LP +# (C) Copyright 2014-2016 Hewlett Packard Enterprise Development LP # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -54,19 +54,13 @@ class RequestTimeoutError(BaseException): """Timeout making a POST, GET, PATCH, DELETE, or PUT request to the server.""" -class KeystoneException(BaseException): +class KeystoneException(Exception): """Base exception for all Keystone-derived exceptions.""" - code = 'N/A' - - def __init__(self, message=None): - super(KeystoneException, self).__init__(message) - try: - log.error("exception: {}".format(message)) - self.error = jsonutils.loads(message) - except Exception: - self.error = {'error': - {'message': self.message or self.__class__.__doc__}} + # This is initialized with the exception raised by the Keystone client so + # deriving this class from Exception instead of BaseException allows that to + # be handled without any additional code + pass class HTTPException(BaseException):