[MERGE] Move RemoteRepository caching logic to CachedParentsProvider
John Arbash Meinel
john at arbash-meinel.com
Thu Dec 11 20:36:40 GMT 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Martin Pool wrote:
> On 11 Dec 2008, Aaron Bentley <aaron at aaronbentley.com> wrote:
>
>>> I'd prefer just a plain AssertionError to further bloating errors.py. I
>>> believe Martin has previously stated that we should try to avoid adding
>>> errors that we never intend to catch.
>
> I have, and I think it still makes sense. If we're just going to show
> it to a user as an error message, it doesn't really matter what class
> would be raised. If code would plausibly want to catch it, to know what
> particular error was raised or what its parameters were, then it should
> have a new class.
>
So the way I've interned your suggestions is.
1) If it is something that a caller can recover from, a custom exception
is reasonable.
2) If it is a data consistency issue, using a builtin like
ValueError/TypeError is reasonable.
3) If it is a programmer error (using an api incorrectly) AssertionError
is reasonable.
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAklBedgACgkQJdeBCYSNAAO8gACffyT26TO1RHaETXEQ3bDtkU5J
BjkAn3EVAoI3XSd767KyvctDWCmvzkBG
=rqeI
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list