[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] svn info - changing hard coded error message to specific one.

From: Julian Foad <julian.foad_at_wandisco.com>
Date: Fri, 24 Dec 2010 15:46:27 +0000

On Fri, 2010-12-24, C. Michael Pilato wrote:
> On 12/23/2010 07:27 AM, Julian Foad wrote:
> >>From IRC:
> >
> > <Bert> julianf: We changed error codes in libsvn_wc all over the place.
> > I don't think we see strict error codes as part of the documented
> > behavior, unless it is in the function documentation
>
> I agree with this. Any time a specific error code is intended for use by an
> API function as a specific message to the caller, we document that fact and
> that behavior becomes part of the contract. Undocumented error codes are
> fair game for changing over time.

OK, then that's fine by me too.

Noorul wrote:
> Daniel Shahaf wrote:
> > Why do you have to place the "svn: " prefix here explicitly?
> Normally
> > svn_handle_error2() would do that for you. This is a red flag ("is
> > a wheel being reinvented here?") for me.
>
> We are actually consuming the error here to print it and proceed with
> the other targets.

Noorul, "svn_handle_error2" has a "fatal" flag that controls whether it
terminates the program or not; setting fatal=FALSE would enable you to
continue processing the other targets. But it prints "the error stack"
which is not what you want here - we want just a single error message.

Try using "svn_handle_warning2" instead. That function appears to do
almost exactly what you want here; the only differences I can see is it
inserts "warning: " before the message, which I think is perfect for
this usage, and it doesn't print the extra "\n", which is easily
rectified.

- Julian
Received on 2010-12-24 16:47:11 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.