[MERGE][bug #230223] Make both http implementations raise appropriate exceptions on 403 Forbidden

Martin Pool mbp at canonical.com
Tue May 20 02:34:22 BST 2008


>> --- bzrlib/transport/http/_pycurl.py  2007-12-20 16:36:44 +0000
>> +++ bzrlib/transport/http/_pycurl.py  2008-05-18 13:59:54 +0000
>> @@ -278,7 +278,8 @@
>>          # requests
>>          if code == 403:
>>              raise errors.TransportError(
>> -                'Server refuses to fullfil the request for: %s' % url)
>> +                'Server refuses to fulfill the request (403 Forbidden)'
>> +                ' for %s' % url)
>
> Good idea.

Maybe we should show the 'reason phrase' (the bit following the
numeric status) rather than assuming/implying it's just 'Forbidden'?
I realize it generally will be that, but it can be easier to debug
connection problems if the client shows what it can...

The real explanation is probably in the message body and that
unfortunately is probably html and not so easy to display...

-- 
Martin <http://launchpad.net/~mbp/>



More information about the bazaar mailing list