[MERGE][#278673] Refactor error handling in bzrlib.remote, removing scope for unhandled errors. Also unify with bzrlib.transport.remote's error handling.
Andrew Bennetts
andrew.bennetts at canonical.com
Wed Oct 29 01:57:49 GMT 2008
This patch fixes <https://bugs.launchpad.net/bzr/+bug/278673>, and builds on my
previous patch.
It extends bzrlib/remote.py's _translate_error to cover all errors from a smart
server, including ones that should only be raised by VFS operations, and updates
bzrlib/transport/remote.py to use that. Thus there's now just one place in the
code responsible for decoding smart server error tuples into exceptions, not
two.
It also improves the API inside bzrlib/remote.py for calling RPCs, so that error
translation is much more automatic. Bug 278673 was caused by forgetting to wrap
all places that do “self._client.call...” in a try-except that catches
ErrorFromSmartServer. There's a new API on the Remote* classes,
“self._call...”, which handles this. This makes the Remote* code less
cluttered, and makes it easier to write correct code.
-Andrew.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: refactor-error-catching.diff
Type: text/x-diff
Size: 36821 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20081029/21f3626e/attachment-0001.bin
More information about the bazaar
mailing list