test_connection_error

Robert Collins robertc at robertcollins.net
Thu Nov 17 22:22:17 GMT 2005


On Wed, 2005-11-16 at 13:45 +1100, Martin Pool wrote:
> after merging from aaron, I have
> 
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/home/mbp/work/bzr.dev/bzrlib/selftest/testtransport.py", line
> 459, in test_connection_error
>     self.assertRaises(ConnectionError, t.get, '.bzr/branch')
>   File "/usr/lib/python2.4/unittest.py", line 320, in failUnlessRaises
>     callableObj(*args, **kwargs)
>   File "/home/mbp/work/bzr.dev/bzrlib/transport/http.py", line 149, in
> get
>     orig_error=e)
> NoSuchFile: no such file: Error retrieving http://www.example.com/.bzr/branch: HTTP Error 404: Not Found
> 
> This is just because of an exception class mismatch, NoSuchFile vs
> ConnectionError.  For the moment I'll just generalize the exception; if
> someone has a strong opinion say so.  

404 vs host not found: The former is NoSuchFile, the latter is a more
fundamental problem. I.e. for the former its reasonable to walk up the
url path probing, for the latter it is not reasonable. I think having
two exceptions is correct.

Rob

-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051118/d448cb00/attachment.pgp 


More information about the bazaar mailing list