~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/http/_pycurl.py

  • Committer: John Arbash Meinel
  • Date: 2006-10-16 01:25:46 UTC
  • mfrom: (2071 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2080.
  • Revision ID: john@arbash-meinel.com-20061016012546-d01a0740671b4d73
[merge] bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
179
179
        # handle_response will raise NoSuchFile, etc based on the response code
180
180
        return code, response.handle_response(abspath, code, headers, data)
181
181
 
182
 
    def _raise_curl_connection_error(self, curl):
183
 
        curl_errno = curl.getinfo(pycurl.OS_ERRNO)
184
 
        url = curl.getinfo(pycurl.EFFECTIVE_URL)
185
 
        raise ConnectionError('curl connection error (%s) on %s'
186
 
                              % (os.strerror(curl_errno), url))
187
 
 
188
182
    def _raise_curl_http_error(self, curl, info=None):
189
183
        code = curl.getinfo(pycurl.HTTP_CODE)
190
184
        url = curl.getinfo(pycurl.EFFECTIVE_URL)
220
214
            mutter('got pycurl error: %s, %s, %s, url: %s ',
221
215
                    e[0], _pycurl_errors.errorcode[e[0]], e, url)
222
216
            if e[0] in (_pycurl_errors.CURLE_COULDNT_RESOLVE_HOST,
223
 
                        _pycurl_errors.CURLE_COULDNT_CONNECT):
224
 
                self._raise_curl_connection_error(curl)
 
217
                        _pycurl_errors.CURLE_COULDNT_CONNECT,
 
218
                        _pycurl_errors.CURLE_COULDNT_RESOLVE_PROXY):
 
219
                raise ConnectionError('curl connection error (%s)\non %s'
 
220
                              % (e[1], url))
225
221
            # jam 20060713 The code didn't use to re-raise the exception here
226
222
            # but that seemed bogus
227
223
            raise