summaryrefslogtreecommitdiff
path: root/keystoneclient/exceptions.py
diff options
context:
space:
mode:
authorGabriel Hurley <gabriel@strikeawe.com>2011-11-17 14:25:04 -0800
committerGabriel Hurley <gabriel@strikeawe.com>2011-11-17 14:25:04 -0800
commit0c2a521974f0a074b2d6db0d8ce3fa33cf6f0105 (patch)
treeca91f77fde62de1466fec6e9960a4ef06ff772e3 /keystoneclient/exceptions.py
parent553947100377ffbb84d9dbbb457e65423365d39f (diff)
downloadpython-keystoneclient-0c2a521974f0a074b2d6db0d8ce3fa33cf6f0105.tar.gz
Improved logging/error messages.
Diffstat (limited to 'keystoneclient/exceptions.py')
-rw-r--r--keystoneclient/exceptions.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/keystoneclient/exceptions.py b/keystoneclient/exceptions.py
index 8f8ea57..eeefe98 100644
--- a/keystoneclient/exceptions.py
+++ b/keystoneclient/exceptions.py
@@ -118,12 +118,13 @@ def from_response(response, body):
"""
cls = _code_map.get(response.status, ClientException)
if body:
- message = "n/a"
- details = "n/a"
if hasattr(body, 'keys'):
error = body[body.keys()[0]]
message = error.get('message', None)
details = error.get('details', None)
+ else:
+ message = body
+ details = None
return cls(code=response.status, message=message, details=details)
else:
return cls(code=response.status)