summaryrefslogtreecommitdiff
path: root/novaclient/exceptions.py
diff options
context:
space:
mode:
authorJohannes Erdfelt <johannes@erdfelt.com>2014-03-20 11:11:12 -0700
committerJohannes Erdfelt <johannes@erdfelt.com>2014-03-20 15:54:19 -0700
commite43825bd1c67d22f012978c5de6feff028c75d40 (patch)
treeff0d0d02526b7db1c1e6917ddb78c569ed940004 /novaclient/exceptions.py
parent8c7524b8bf6a5eb1f0bc77515e9ad95bdee826b0 (diff)
downloadpython-novaclient-e43825bd1c67d22f012978c5de6feff028c75d40.tar.gz
Print a useful message for unknown server errors
If a server error is returned that has an unknown code, novaclient will end up printing something similar to: ClientException: <attribute 'message' of 'exceptions.BaseException' objects> Setting a message for ClientException will ensure that something more useful than that is printed. Change-Id: I43a2a33017f9a5c1b79d7fd8af4153e91d296f7b Closes-bug: 1295293
Diffstat (limited to 'novaclient/exceptions.py')
-rw-r--r--novaclient/exceptions.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/novaclient/exceptions.py b/novaclient/exceptions.py
index 9f22a9e3..a987c562 100644
--- a/novaclient/exceptions.py
+++ b/novaclient/exceptions.py
@@ -81,6 +81,8 @@ class ClientException(Exception):
"""
The base exception class for all exceptions this library raises.
"""
+ message = 'Unknown Error'
+
def __init__(self, code, message=None, details=None, request_id=None,
url=None, method=None):
self.code = code