You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Julian Foad <ju...@btopenworld.com> on 2003/12/08 19:47:29 UTC

Re: svn commit: rev 7956 - in trunk: . subversion/libsvn_subr

dionisos@tigris.org wrote:
> Author: dionisos
> Date: Mon Dec  8 12:19:26 2003
> New Revision: 7956
[...]
> Modified: trunk/HACKING
[...]
> +   * Please wrap your lines in such a way that the message text (if you 
> +     supply any) so that the message appears on the start of a new line.

Oops - too many words.

> +     Like:
> +
> +        svn_error_createf (SVN_ERR_FOO, NULL,
> +                           "Authorisation failed for '%s'", url);

I don't see the point of making this a formal convention.  It often happens naturally, but if an error message is very short, why not put it on the end of the first line; and what if the error message is not a simple constant string but, say, a function call like apr_psprintf(pool, "Format", args) or an expression like (query ? "Query" : "Other") ?

> +2.  If you are the *original* creator of an error, you would do
> +    something like this:
> +
> +        return svn_create_error (SVN_ERR_FOO, NULL, 
> +                                  "User not permitted to write file");

Sorry I didn't notice this before, but the function is actually called "svn_error_create".  (And the indentation is a bit off, but this is only a "README".)

- Julian



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: rev 7956 - in trunk: . subversion/libsvn_subr

Posted by Erik Huelsmann <e....@gmx.net>.
> On Mon, 2003-12-08 at 14:52, Erik Huelsmann wrote:
> > Well, I did, because Greg Hudson just changed the code to adhere to this
> > convention.
> 
> Not deliberately; I think most of the things I changed were already like
> that.  I prefer to put the error message on the same line when possible;
> it just doesn't always fit.

Ok. That's two against this part of the change. If nobody pleas strongly for
it I guess I'll just remove it again.

> (I've seriously thought about proposing to shorten the function names so
> that things fit on one line more often.  Something like:
> 
>    svn_error_create	--> (gone)
>    svn_error_createf	--> svn_err
>    svn_error_quick_wrap	--> svn_err_wrap (and add fmt/args)
>    svn_error_wrap_apr	--> svn_err_apr
> 
> But that would be a lot of churn.)

It would, but I never saw any use for svn_error_create (). I indeed did see
use for svn_error_quick_wrapf (). It does seem rather pointless to change all
that before 1.0 though... In principle I agree with you and when we have 1.0
I even might give it a try...

bye,

Erik.

-- 
+++ GMX - die erste Adresse für Mail, Message, More +++
Neu: Preissenkung für MMS und FreeMMS! http://www.gmx.net



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: rev 7956 - in trunk: . subversion/libsvn_subr

Posted by Greg Hudson <gh...@MIT.EDU>.
On Mon, 2003-12-08 at 14:52, Erik Huelsmann wrote:
> Well, I did, because Greg Hudson just changed the code to adhere to this
> convention.

Not deliberately; I think most of the things I changed were already like
that.  I prefer to put the error message on the same line when possible;
it just doesn't always fit.

(I've seriously thought about proposing to shorten the function names so
that things fit on one line more often.  Something like:

   svn_error_create	--> (gone)
   svn_error_createf	--> svn_err
   svn_error_quick_wrap	--> svn_err_wrap (and add fmt/args)
   svn_error_wrap_apr	--> svn_err_apr

But that would be a lot of churn.)


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: svn commit: rev 7956 - in trunk: . subversion/libsvn_subr

Posted by Erik Huelsmann <e....@gmx.net>.
> dionisos@tigris.org wrote:
> > Author: dionisos
> > Date: Mon Dec  8 12:19:26 2003
> > New Revision: 7956
> [...]
> > Modified: trunk/HACKING
> [...]
> > +   * Please wrap your lines in such a way that the message text (if you
> 
> > +     supply any) so that the message appears on the start of a new
> line.
> 
> Oops - too many words.

Oops indeed.

> > +     Like:
> > +
> > +        svn_error_createf (SVN_ERR_FOO, NULL,
> > +                           "Authorisation failed for '%s'", url);
> 
> I don't see the point of making this a formal convention.  It often
> happens naturally, but if an error message is very short, why not put it
on the
> end of the first line; and what if the error message is not a simple
> constant string but, say, a function call like apr_psprintf(pool,
"Format", args)
> or an expression like (query ? "Query" : "Other") ?

Well, I did, because Greg Hudson just changed the code to adhere to this
convention. If it is not possible ot do it this way, then it isn't. I still
think it's good to mention that it is the general idea.

bye,

Erik.

-- 
+++ GMX - die erste Adresse für Mail, Message, More +++
Neu: Preissenkung für MMS und FreeMMS! http://www.gmx.net



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org