Improve error message.

Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/8c520080
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/8c520080
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/8c520080

Branch: refs/heads/trunk
Commit: 8c52008043c3fd3ebf5ad8ec20d85100388f52ed
Parents: 8cdde92
Author: Tomaz Muraus <[email protected]>
Authored: Tue Feb 23 10:57:54 2016 +0100
Committer: Tomaz Muraus <[email protected]>
Committed: Tue Feb 23 10:57:54 2016 +0100

----------------------------------------------------------------------
 libcloud/common/base.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/8c520080/libcloud/common/base.py
----------------------------------------------------------------------
diff --git a/libcloud/common/base.py b/libcloud/common/base.py
index 9b0d6b9..1321f45 100644
--- a/libcloud/common/base.py
+++ b/libcloud/common/base.py
@@ -829,9 +829,11 @@ class Connection(object):
                 # with hostname" error. This error could simpli indicate that
                 # "host" Connection class attribute is set to an incorrect
                 # value
-                msg = ('%s. Perhaphs "host" Connection class attribute (%s) '
-                       'is set to an invalid, non-hostname value?' %
-                       (message, self.host))
+                class_name = self.__class__.__name__
+                msg = ('%s. Perhaphs "host" Connection class attribute '
+                       '(%s.connection) is set to an invalid, non-hostname '
+                       'value (%s)?' %
+                       (message, class_name, self.host))
                 raise socket.gaierror(msg)
             self.reset_context()
             raise e

Reply via email to