~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/plugins/launchpad/lp_registration.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-07-05 00:25:41 UTC
  • mfrom: (4505.4.1 gaierror-247958)
  • Revision ID: pqm@pqm.ubuntu.com-20090705002541-i0ha0d7rhevfxdil
(jml) Trap gaierror and re-raise ConnectionError in Launchpad
        directory service,
        giving a nicer error message when DNS lookup fails. Fixes bug 247958.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
 
18
 
from getpass import getpass
19
18
import os
 
19
import socket
20
20
from urlparse import urlsplit, urlunsplit
21
21
import urllib
22
22
import xmlrpclib
177
177
                # TODO: print more headers to help in tracking down failures
178
178
                raise errors.BzrError("xmlrpc protocol error connecting to %s: %s %s"
179
179
                        % (self.service_url, e.errcode, e.errmsg))
 
180
        except socket.gaierror, e:
 
181
            raise errors.ConnectionError(
 
182
                "Could not resolve '%s'" % self.domain,
 
183
                orig_error=e)
180
184
        return result
181
185
 
182
186
    @property