summaryrefslogtreecommitdiff
path: root/keystoneclient/exceptions.py
diff options
context:
space:
mode:
Diffstat (limited to 'keystoneclient/exceptions.py')
-rw-r--r--keystoneclient/exceptions.py30
1 files changed, 11 insertions, 19 deletions
diff --git a/keystoneclient/exceptions.py b/keystoneclient/exceptions.py
index d01ff74..e140a5e 100644
--- a/keystoneclient/exceptions.py
+++ b/keystoneclient/exceptions.py
@@ -12,20 +12,7 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
-"""
-Exception definitions.
-
-.. py:exception:: AuthorizationFailure
-
-.. py:exception:: ClientException
-
-.. py:exception:: HttpError
-
-.. py:exception:: ValidationError
-
-.. py:exception:: Unauthorized
-
-"""
+"""Exception definitions."""
from keystoneauth1 import exceptions as new_exceptions
@@ -68,7 +55,6 @@ GatewayTimeout = new_exceptions.GatewayTimeout
HttpVersionNotSupported = new_exceptions.HttpVersionNotSupported
from_response = new_exceptions.from_response
-
# NOTE(jamielennox): Rahh! this is just wrong. In the apiclient conversion
# someone mapped the connection timeout onto the HTTP timeout exception. Assume
# people want the connection timeout as this is much more common.
@@ -82,9 +68,7 @@ Timeout = new_exceptions.ConnectTimeout
# NOTE(akurilin): This alias should be left here to support backwards
# compatibility until we are sure that usage of these exceptions in
# projects is correct.
-ConnectionRefused = ConnectionError
HTTPNotImplemented = HttpNotImplemented
-Timeout = RequestTimeout
HTTPError = HttpError
@@ -105,19 +89,27 @@ class MultipleChoices(HTTPRedirection):
class ValidationError(ClientException):
"""Error in validation on API client side."""
+ pass
class UnsupportedVersion(ClientException):
"""User is trying to use an unsupported version of the API."""
+ pass
class CommandError(ClientException):
"""Error in CLI tool."""
+ pass
AuthorizationFailure = new_exceptions.AuthorizationFailure
+class ConnectionRefused(ConnectionError):
+ """Connection refused while trying to connect to API service."""
+ pass
+
+
class AuthPluginOptionsMissing(AuthorizationFailure):
"""Auth plugin misses some options."""
def __init__(self, opt_names):
@@ -131,7 +123,7 @@ class AuthSystemNotFound(AuthorizationFailure):
"""User has specified an AuthSystem that is not installed."""
def __init__(self, auth_system):
super(AuthSystemNotFound, self).__init__(
- _("AuthSystemNotFound: %s") % repr(auth_system))
+ _("AuthSystemNotFound: %r") % auth_system)
self.auth_system = auth_system
@@ -165,7 +157,7 @@ class AmbiguousEndpoints(EndpointException):
"""Found more than one matching endpoint in Service Catalog."""
def __init__(self, endpoints=None):
super(AmbiguousEndpoints, self).__init__(
- _("AmbiguousEndpoints: %s") % repr(endpoints))
+ _("AmbiguousEndpoints: %r") % endpoints)
self.endpoints = endpoints