summaryrefslogtreecommitdiff
path: root/novaclient/exceptions.py
diff options
context:
space:
mode:
authorAndrew Laski <andrew.laski@rackspace.com>2012-09-07 15:59:42 -0400
committerAndrew Laski <andrew.laski@rackspace.com>2012-09-07 16:04:54 -0400
commit8cff1a20bc3962ec147f5f7c6807bc4c863eae36 (patch)
tree42717ea9e7146ddff5f7070a1e927e94b87b2dd4 /novaclient/exceptions.py
parentd6f767f8a3239aa314a9322720d0e543f2e07065 (diff)
downloadpython-novaclient-8cff1a20bc3962ec147f5f7c6807bc4c863eae36.tar.gz
Add ConnectionRefused exception.
When novaclient gets a Connection Refused it now presents that as a ConnectionRefused exception with appropriate information rather than as an HTTP exception. Addresses bug 1047078. vagrant@precise64:/opt/stack/python-novaclient$ nova image-list ERROR: ConnectionRefused: '[Errno 111] Connection refused' Change-Id: Iebf4d78a524004d5e79d2219b35f90fbd38ee690
Diffstat (limited to 'novaclient/exceptions.py')
-rw-r--r--novaclient/exceptions.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/novaclient/exceptions.py b/novaclient/exceptions.py
index da626921..da6f8d4c 100644
--- a/novaclient/exceptions.py
+++ b/novaclient/exceptions.py
@@ -51,6 +51,17 @@ class AmbiguousEndpoints(Exception):
return "AmbiguousEndpoints: %s" % repr(self.endpoints)
+class ConnectionRefused(Exception):
+ """
+ Connection refused: the server refused the connection.
+ """
+ def __init__(self, response=None):
+ self.response = response
+
+ def __str__(self):
+ return "ConnectionRefused: %s" % repr(self.response)
+
+
class ClientException(Exception):
"""
The base exception class for all exceptions this library raises.