[BUG] improve error messages
Robert Collins
robertc at robertcollins.net
Wed Sep 14 19:16:03 BST 2005
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.
Rob
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050915/30eb66d0/attachment.pgp
More information about the bazaar
mailing list