~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/http.py

[merge] robertc's integration, updated tests to check for retcode=3

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
from bzrlib.transport import Transport, register_transport
20
20
from bzrlib.errors import (TransportNotPossible, NoSuchFile, 
21
 
                           NonRelativePath, TransportError)
 
21
                           NonRelativePath, TransportError, ConnectionError)
22
22
import os, errno
23
23
from cStringIO import StringIO
24
24
import urllib2
142
142
        """
143
143
        try:
144
144
            return get_url(self.abspath(relpath))
145
 
        except urllib2.URLError, e:
146
 
            if getattr(e, 'code', None) == 404:
 
145
        except urllib2.HTTPError, e:
 
146
            if e.code == 404:
147
147
                raise NoSuchFile(msg = "Error retrieving %s: %s" 
148
148
                                 % (self.abspath(relpath), str(e)),
149
149
                                 orig_error=e)
150
150
            raise
151
151
        except (BzrError, IOError), e:
152
 
            raise NoSuchFile(msg = "Error retrieving %s: %s" 
 
152
            raise ConnectionError(msg = "Error retrieving %s: %s" 
153
153
                             % (self.abspath(relpath), str(e)),
154
154
                             orig_error=e)
155
155