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

Missing error messages with svn_error_quick_wrap [was: Re: " Inconsistent line-endings"]

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2004-03-20 17:04:23 CET

Julian Foad wrote:
> Ben Reser wrote:
>
>> In the process of looking for this I went looking for the error text.
>>
>> I couldn't find it. So I went and found it on the 1.0.x branch and then
>> found the code location on trunk. The error text was removed in r8908.
>> We were outputing this in 1.0.x:
>> $ svn ci -m 'test2'
>> Sending foo
>> Transmitting file data .svn: Commit failed (details follow):
>> svn: Inconsistent line-endings in source stream
>>
>> Now we output:
>> $ ~/wc/svn-trunk/subversion/clients/cmdline/svn ci -m 'test2'
>> Sending foo
>> Transmitting file data .subversion/libsvn_client/commit.c:747:
>> (apr_err=135000)
>> svn: Commit failed (details follow):
>> subversion/libsvn_subr/subst.c:454: (apr_err=135000)
>>
>> Note the complete and utter lack of details that follow.
>>
>> I think the changes to subversion/libsvn_subr/time.c and
>> subversion/libsvn_subr/subst.c in r8908 should be reverted. Opinions?
>
> Only if we can't make it work the way r8908 was intended to work, which
> is that the generic error message corresponding to
> SVN_ERR_IO_INCONSISTENT_EOL should be printed without having to put a
> copy of the message text in the source code at each point of call.

The problem is not in r8908, but in the interaction between "svn_error_quick_wrap" and "svn_handle_error".

"svn_error_quick_wrap" creates a wrapper error with the same error code as the wrapped error. If the wrapped error doesn't have an explicit message, "svn_handle_error" then doesn't print it at all (apart from the file and line debugging info).

I think the best solution is for "svn_error_quick_wrap" to use the error code SVN_ERR_BASE rather than copy the wrapped error code. The default text for SVN_ERR_BASE is "A problem occurred; see later errors for details", which is exactly what "svn_error_quick_wrap" is for.

Index: subversion/libsvn_subr/error.c
===================================================================
--- subversion/libsvn_subr/error.c (revision 9166)
+++ subversion/libsvn_subr/error.c (working copy)
@@ -185,7 +185,7 @@
 svn_error_t *
 svn_error_quick_wrap (svn_error_t *child, const char *new_msg)
 {
- return svn_error_create (child->apr_err,
+ return svn_error_create (SVN_ERR_BASE,
                            child,
                            new_msg);
 }

It fixes the case that you noticed. I'll commit it in a copule of days if it passes regression tests and there are no adverse comments.

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Mar 20 17:02:01 2004

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.