diff options
author | Jamie Lennox <jamielennox@redhat.com> | 2014-04-04 11:17:24 +1000 |
---|---|---|
committer | Jamie Lennox <jamielennox@redhat.com> | 2014-04-15 09:41:33 +1000 |
commit | 4a81a146859cf783c876dc0e8d580333c246596c (patch) | |
tree | 665da548b736cfc03f441be0c67bdc238d5be2db /keystoneclient/exceptions.py | |
parent | ce92f37f0be5c6293ddb744eb618db91dda0b058 (diff) | |
download | python-keystoneclient-4a81a146859cf783c876dc0e8d580333c246596c.tar.gz |
Add new error for invalid response
There are a number of places where we expect a certain format of
response. If it's not found we often end up raising a KeyError when
accessing data.
Create a new Exception type that is raised when a HTTP response is not
appropriate for parsing and use it within authentication calls.
Closes-Bug: #1307306
Change-Id: I3cf2db07a8e76ee17702130e9efb0edf640d293a
Diffstat (limited to 'keystoneclient/exceptions.py')
-rw-r--r-- | keystoneclient/exceptions.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/keystoneclient/exceptions.py b/keystoneclient/exceptions.py index d9d3f38..4572af9 100644 --- a/keystoneclient/exceptions.py +++ b/keystoneclient/exceptions.py @@ -61,3 +61,11 @@ class MissingAuthPlugin(ClientException): class NoMatchingPlugin(ClientException): """There were no auth plugins that could be created from the parameters provided.""" + + +class InvalidResponse(ClientException): + """The response from the server is not valid for this request.""" + + def __init__(self, response): + super(InvalidResponse, self).__init__() + self.response = response |