~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/http.py

  • Committer: Robert Collins
  • Date: 2005-10-19 06:33:38 UTC
  • Revision ID: robertc@robertcollins.net-20051019063338-45b891502a09911c
The HTTP transport would return NoSuchFile inappropriately.

bzrlib.transport.http has been modified so that only 404 urllib errors
are returned as NoSuchFile. Other exceptions will propogate as normal.
This allows debuging of actual errors. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
125
125
            f.read()
126
126
            f.close()
127
127
            return True
128
 
        except BzrError:
129
 
            return False
130
 
        except urllib2.URLError:
131
 
            return False
 
128
        except urllib2.URLError, e:
 
129
            if e.code == 404:
 
130
                return False
 
131
            raise
132
132
        except IOError, e:
133
133
            if e.errno == errno.ENOENT:
134
134
                return False
141
141
        """
142
142
        try:
143
143
            return get_url(self.abspath(relpath))
144
 
        except (BzrError, urllib2.URLError, IOError), e:
 
144
        except urllib2.URLError, e:
 
145
            if e.code == 404:
 
146
                raise NoSuchFile(msg = "Error retrieving %s: %s" 
 
147
                                 % (self.abspath(relpath), str(e)),
 
148
                                 orig_error=e)
 
149
            raise
 
150
        except (BzrError, IOError), e:
145
151
            raise NoSuchFile(msg = "Error retrieving %s: %s" 
146
152
                             % (self.abspath(relpath), str(e)),
147
153
                             orig_error=e)