[BUG] improve error messages

John A Meinel john at arbash-meinel.com
Wed Sep 14 21:38:02 BST 2005


Aaron Bentley wrote:
> John A Meinel wrote:
>
>
>>>>I don't think that anything in branch should throw a CommandError - it
>>>>hides too much information. Rather I think that the commands run()
>>>>should catch NotBranchError and convert that to a nice error message.
>>>
>>>
>>>Well, at first that is what I thought, too. But I was concerned that
>>>then *every* command would have to re-implement the same error trapping.
>>>What about having "find_branch_for_command()" which throws a better set
>>>of errors?
>
>
> What I've done is implemented the rethrowing in bzrlib.commands.main.
> That should avoid the code duplication.  The problem with
> find_branch_for_command is, when do we use it, instead of find_branch?

Well, basically in any command that takes user input and then tries to
grab a branch based on it. So in the cmd_*.run() functions.

But I'm fine with a special trapping in bzrlib.commands.main()

John
=:->

>
> Aaron
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 253 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050914/6eb96718/attachment.pgp 


More information about the bazaar mailing list