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

[PATCH] Simplify reporting of API violations of the conflict resolver callback.

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Mon, 14 Jul 2008 10:47:04 +0100

If the conflict resolver callback violates its API (e.g. returns NULL or
doesn't generate a result file when it says it has done), we presently
generate a custom error message:

> if (result == NULL)
> return svn_error_create(SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE,
> NULL, _("Conflict callback violated API:"
> " returned no results"));

This happens in 5 places and some are longer than the quoted example. My
instinct is to simplify by using just a SVN_ERR_ASSERT statement, like
this:

> SVN_ERR_ASSERT(result);

See the attached patch.

Should I do this?

My reasons: I think it makes the normal code path easier to read. I
don't think we have custom error messages for other API violation error
returns. It gets rid of some messages that are meaningful only to
programmers but of limited use to programmers, and relieves the
translators of translating them. I can't think of strong
counter-arguments but I'm wary that there may be some.

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org

Received on 2008-07-14 11:48:25 CEST

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.