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

Martin Pool martinpool at gmail.com
Mon Sep 19 00:57:44 BST 2005


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.

-- 
Martin




More information about the bazaar mailing list