[MERGE] document when to use custom exception classes (was Move RemoteRepository caching logic to CachedParentsProvider)

Martin Pool mbp at sourcefrog.net
Fri Dec 12 00:25:55 GMT 2008


John Arbash Meinel wrote:
> 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.
I think that's a good summary; here's a patch that adds it to the 
HACKING file.

-- 
Martin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 20081211-doc-exceptions.diff
Type: text/x-patch
Size: 3299 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20081211/fddb0263/attachment.bin 


More information about the bazaar mailing list