[MERGE][#278673] Refactor error handling in bzrlib.remote, removing scope for unhandled errors. Also unify with bzrlib.transport.remote's error handling.

John Arbash Meinel john at arbash-meinel.com
Wed Oct 29 18:57:09 GMT 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Andrew Bennetts wrote:
> 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.
> 
> 

BB:approve

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkkIsgUACgkQJdeBCYSNAANvwACfQljDQbHVVu3nmc0pJS7RiWnd
9ZUAoJChApJPkH5HI5Z15x8h+sbe5sN0
=rx9g
-----END PGP SIGNATURE-----



More information about the bazaar mailing list