[MERGE][#246233] Allow ConnectionReset to propagate from read_mergeable_from_url.
Andrew Bennetts
andrew at canonical.com
Fri Sep 12 03:24:08 BST 2008
This small change fixes one of the remaining causes of TooManyConcurrentRequests
errors. "bzr pull" and "bzr merge" both first try opening the URL as a bundle
via read_mergeable_from_url, but if the connection failed that function was
raising NotABundle instead of propagating the ConnectionReset.
This fix is a two-liner (catch ConnectionReset explicitly and re-raise it), and
I've included a test which unfortunately is a bit longer, but still quite
simple.
Perhaps a deeper fix would be to re-examine our exception hierarchy;
maybe ConnectionReset should not subclass TransportError. It's also not
immediately obvious why read_mergeable_from_url catches TransportError — I'm
guessing that's what “transport.get('directory-name')” usually raises? A
comment is probably warranted. But instead of letting the perfect be the enemy
of the good, I'm submitting a simple and clearly correct patch.
With this patch, users get a fairly sensible error message rather than a
traceback, e.g.:
$ ./bzr pull bzr+ssh://no-such-user@bazaar.launchpad.net/
No such Launchpad account: no-such-user
Permission denied (publickey).
bzr: ERROR: Connection closed: please check connectivity and permissions (and try -Dhpss if further diagnosis is required)
-Andrew.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smart-pull-bug-246233-3704.patch
Type: text/x-diff
Size: 6051 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080912/38e16739/attachment.bin
More information about the bazaar
mailing list