[BUG] improve error messages

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


Robert Collins wrote:
> On Wed, 2005-09-14 at 07:02 -0400, John A Meinel wrote:
>
>
>>I just checked, and it is throwing NotBranchError, which is a
>>specialized exception inherited from BzrError (where tracebacks are
>>printed). Doing the simple "Inherit from BzrCommandError" did indeed
>>remove the traceback. But is NotBranchError always be a simple user
>>error? I'm guessing in some places it is there to trap for real errors.
>
>
> Right, this is the usual dichotomy between ui logic and library logic.
>
>
>>So what about find_branch_root(), should it ever print a traceback? My
>>personal feeling is it shouldn't print a traceback whenever it is called
>>from a cmd_*.run() function, since that indicates that a user specified
>>the name directly. But if it is deeper in the core, then it is harder to
>>say, since it might indicate a bug.
>>
>>I guess I would change find_branch_root() so that it throws a
>>BzrCommandError.
>
>
> 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?

John
=:->

>
> Rob
>

-------------- 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/df82bb44/attachment.pgp 


More information about the bazaar mailing list