[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] "throw usage(); " or "N(); " for argument checking?

From: Timothy Brownawell
Subject: Re: [Monotone-devel] "throw usage(); " or "N(); " for argument checking?
Date: Sun, 04 Jan 2009 18:30:54 +0000

On Sun, 2009-01-04 at 18:41 +0100, Markus Wanner wrote:
> Hi,
> Timothy Brownawell wrote:
> > "N(false, message)" results in "throw informative_faulure(message)", the
> > question is what to throw rather than whether to throw.
> I'm with Timothy on that. These states are exceptional enough and much
> simpler to code. While "control loops" (why a loop, simple conditions
> would do, no?) clutter .. ehm.. exception handling a lot.
> > A command that does "throw usage()" gives the same result as calling
> > "mtn help <command>", printing full usage info to stderr, where N()
> > results in "mtn: misuse: <message>" on stderr and will put a note in any
> > debug log.
> As long as the <message> is maintained in case of "throw usage()", I'm
> fine. I dislike tools which just throw the complete usage page at me and
> let me figure myself. Some hint on what's wrong certainly helps. And
> that hint should survive, IMO.

So I guess we should standardize on "throw usage()", but give usage a
what() and make the constructor take a message.


Free (experimental) public monotone hosting:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]