Merge lp://qastaging/~jml/bzr/gaierror-247958 into lp://qastaging/~bzr/bzr/trunk-old

Proposed by Jonathan Lange
Status: Merged
Merged at revision: not available
Proposed branch: lp://qastaging/~jml/bzr/gaierror-247958
Merge into: lp://qastaging/~bzr/bzr/trunk-old
Diff against target: 24 lines
To merge this branch: bzr merge lp://qastaging/~jml/bzr/gaierror-247958
Reviewer Review Type Date Requested Status
John A Meinel Approve
Review via email: mp+8223@code.qastaging.launchpad.net
To post a comment you must log in.
Revision history for this message
Jonathan Lange (jml) wrote :

This patch traps DNS errors that occur when resolving LP urls and raises connection errors, thus avoiding terrible tracebacks.

Revision history for this message
John A Meinel (jameinel) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jonathan Lange wrote:
> Jonathan Lange has proposed merging lp:~jml/bzr/gaierror-247958 into lp:bzr.
>
> Requested reviews:
> bzr-core (bzr-core)
>
> This patch traps DNS errors that occur when resolving LP urls and raises connection errors, thus avoiding terrible tracebacks.
>

 vote approve

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkpPosoACgkQJdeBCYSNAAO3WgCfafGlAKyFZ9JXcdhpyQfXsNaC
VNMAn3cUcMQZ2kiUpUcWaOkCtSlTDJQq
=VKa/
-----END PGP SIGNATURE-----

review: Approve
Revision history for this message
Vincent Ladeuil (vila) wrote :

Review approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bzrlib/plugins/launchpad/lp_registration.py'
2--- bzrlib/plugins/launchpad/lp_registration.py 2009-06-08 02:54:44 +0000
3+++ bzrlib/plugins/launchpad/lp_registration.py 2009-07-04 17:35:10 +0000
4@@ -15,8 +15,8 @@
5 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6
7
8-from getpass import getpass
9 import os
10+import socket
11 from urlparse import urlsplit, urlunsplit
12 import urllib
13 import xmlrpclib
14@@ -177,6 +177,10 @@
15 # TODO: print more headers to help in tracking down failures
16 raise errors.BzrError("xmlrpc protocol error connecting to %s: %s %s"
17 % (self.service_url, e.errcode, e.errmsg))
18+ except socket.gaierror, e:
19+ raise errors.ConnectionError(
20+ "Could not resolve '%s'" % self.domain,
21+ orig_error=e)
22 return result
23
24 @property