From 1bd9d8e53cf6c2570acababebc6c00e675cc84ef Mon Sep 17 00:00:00 2001
From: Yann Leboulanger <asterix@lagaule.org>
Date: Fri, 19 Jul 2013 21:12:11 +0200
Subject: [PATCH] improve error message when we cannot connect to a host via a
 proxy. Fixes #7358

---
 src/common/connection.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/common/connection.py b/src/common/connection.py
index 53592455d8..99e5d0463b 100644
--- a/src/common/connection.py
+++ b/src/common/connection.py
@@ -1262,7 +1262,12 @@ class Connection(CommonConnection, ConnectionHandlers):
             # we are not retrying, and not conecting
             if not self.retrycount and self.connected != 0:
                 self.disconnect(on_purpose = True)
-                pritxt = _('Could not connect to "%s"') % self._hostname
+                if self._proxy:
+                    pritxt = _('Could not connect to "%(host)s" via proxy "%(proxy)s"') %\
+                        {'host': self._hostname, 'proxy': self._proxy['host']}
+                else:
+                    pritxt = _('Could not connect to "%(host)s"') % {'host': \
+                        self._hostname}
                 sectxt = _('Check your connection or try again later.')
                 if self.streamError:
                     # show error dialog
-- 
GitLab