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

[PATCH] Make svn_err_best_message() skip tracing-only error chain links.

From: C. Michael Pilato <cmpilato_at_collab.net>
Date: Fri, 09 Oct 2009 17:02:42 -0400

Hey, I've got a crazy working copy state at the moment, but I wanted to pass
this patch off for review (and commit, if you get a chance to test it and
it's all good) lest I forget about it.

Simple change, really, just making svn_err_best_message() skip past the
tracing-only error chain links when choosing which error message to return.
 Some chance that it breaks a test expectation somewhere, though, I guess,
so I didn't want to commit up without testing, and I haven't time to do that
right now.

-- 
C. Michael Pilato <cmpilato_at_collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2405676

Skip past tracing-only error chain links when choosing the "best error
message". This allows admins to see, for example, the following in
their Apache error_log:

   [Fri Oct 09 16:37:00 2009] [error] [client 127.0.0.1] Failed to load the \
   AuthzSVNAccessFile: Circular dependency between groups 'devs1' and 'devs'

instead of this considerable less-helpful error:

   [Fri Oct 09 16:25:28 2009] [error] [client 127.0.0.1] Failed to load the \
   AuthzSVNAccessFile: traced call

* subversion/libsvn_subr/error.c:
  (svn_err_best_message): Skip past tracing-only error chain links.
  (svn_handle_warning2): Don't skip past tracing-only error chain
    links here, as svn_err_best_message() (which this function calls)
    will do that for us now.

Index: subversion/libsvn_subr/error.c
===================================================================
--- subversion/libsvn_subr/error.c (revision 39902)
+++ subversion/libsvn_subr/error.c (working copy)
@@ -526,10 +526,6 @@
 {
   char buf[256];
 
- /* Skip over any trace records. */
- while (is_tracing_link(err))
- err = err->child;
-
   svn_error_clear(svn_cmdline_fprintf
                   (stream, err->pool,
                    _("%swarning: %s\n"),
@@ -540,6 +536,9 @@
 const char *
 svn_err_best_message(svn_error_t *err, char *buf, apr_size_t bufsize)
 {
+ /* Skip over any trace records. */
+ while (is_tracing_link(err))
+ err = err->child;
   if (err->message)
     return err->message;
   else

Received on 2009-10-09 23:02:56 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.