Rev 4509: (jml) Trap gaierror and re-raise ConnectionError in Launchpad in file:///home/pqm/archives/thelove/bzr/%2Btrunk/
Canonical.com Patch Queue Manager
pqm at pqm.ubuntu.com
Sun Jul 5 01:25:43 BST 2009
At file:///home/pqm/archives/thelove/bzr/%2Btrunk/
------------------------------------------------------------
revno: 4509 [merge]
revision-id: pqm at pqm.ubuntu.com-20090705002541-i0ha0d7rhevfxdil
parent: pqm at pqm.ubuntu.com-20090704093710-udcizb09il1uu4yf
parent: jml at canonical.com-20090704162216-lnyybdcx819s1p07
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Sun 2009-07-05 01:25:41 +0100
message:
(jml) Trap gaierror and re-raise ConnectionError in Launchpad
directory service,
giving a nicer error message when DNS lookup fails. Fixes bug 247958.
modified:
bzrlib/plugins/launchpad/lp_registration.py lp_registration.py-20060315190948-daa617eafe3a8d48
=== modified file 'bzrlib/plugins/launchpad/lp_registration.py'
--- a/bzrlib/plugins/launchpad/lp_registration.py 2009-06-08 02:54:44 +0000
+++ b/bzrlib/plugins/launchpad/lp_registration.py 2009-07-04 16:22:16 +0000
@@ -15,8 +15,8 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-from getpass import getpass
import os
+import socket
from urlparse import urlsplit, urlunsplit
import urllib
import xmlrpclib
@@ -177,6 +177,10 @@
# TODO: print more headers to help in tracking down failures
raise errors.BzrError("xmlrpc protocol error connecting to %s: %s %s"
% (self.service_url, e.errcode, e.errmsg))
+ except socket.gaierror, e:
+ raise errors.ConnectionError(
+ "Could not resolve '%s'" % self.domain,
+ orig_error=e)
return result
@property
More information about the bazaar-commits
mailing list