[PATCH] more informative error for bzr add (when parent is unversioned)

John A Meinel john at arbash-meinel.com
Mon Sep 19 01:46:49 BST 2005


Martin Pool wrote:
> On 18/09/05, John A Meinel <john at arbash-meinel.com> wrote:
>
>>I think the error message itself is okay:
>>
>>bzr: ERROR: /usr/bin is not in a branch
>>
>>But it shouldn't include the traceback. The problem is that
>>find_branch_root throws a NotBranchError, which gets treated as a
>>regular BzrError, not a BzrCommandError. I think it was discussed to
>>trap it at some level and complain properly.
>
>
> I agree that this should just give the error message.
>
> The basic problem is that there are some problems which can occur
> either because of a user or environment error, or because of a bug.
> Take 'file not found' for example; it might occur if the user tries to
> access a nonexistent file or if our code does.
>
> When there's a problem which may be a bug we should show the line
> number to aid in error reporting.
>
> Perhaps we can have some classes of exceptions only thrown for genuine
> user errors, and not show the line number etc for them.
> NotBranchError could be one.  We can always log the traceback in case
> it is a bug after all.
>

Isn't that what BzrCommandError is for? If you just subclassed
NotBranchError from it, you would just report the error.

John
=:->

-------------- 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/20050918/941fdc5d/attachment.pgp 


More information about the bazaar mailing list