On Fri, 2008-06-13 at 08:25 -0700, Blair Zajac wrote:
> I decided that I wasn't happy ignoring errors here, even if consistency checks
> can be made earlier: r31729.
>
> With this change, I can also remove an assert(): r31730.
- assert(name);
+ if (! name)
+ return svn_error_createf
+ (SVN_ERR_INCORRECT_PARAMS, NULL,
+ _("write_entry() cannot be called with a NULL name argument"));
This change implies that returning an svn_error_t with a localisable
message is inherently "better" than an assertion, but it trades a
potential behavioural improvement (if such a bug exists in our library,
a program using it can trap it cleanly rather than aborting) for a
decrease in readability (4 lines just to indicate one simple fact) and
an increase in translator effort.
I can't single out and complain against this particular case: it's a
dilemma we've always had. However, this has prompted me into proposing a
solution. See the new thread entitled "[RFC] Replacement for "assert" in
the libraries".
- 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-06-13 18:23:25 CEST