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

Printing error stacks. (was: Re: svn_error_symbolic_name)

From: C. Michael Pilato <cmpilato_at_collab.net>
Date: Fri, 12 Apr 2013 14:34:26 -0400

Daniel, I find the current error display really ... weighty, for lack of a
better term. It's difficult to pick out the meat of the message amongst the
overwhelming amount of repetitive, all-caps symbolic names of error codes.

Something to consider: omit the symbolic name from the printed error lines,
but after the final error stack level is printed, print a mapping of codes
to names. So, rather than this:

subversion/svn/checkout-cmd.c:168: (apr_err=SVN_ERR_RA_LOCAL_REPOS_OPEN_FAILED)
subversion/libsvn_client/checkout.c:197:
(apr_err=SVN_ERR_RA_LOCAL_REPOS_OPEN_FAILED)
subversion/libsvn_client/checkout.c:100:
(apr_err=SVN_ERR_RA_LOCAL_REPOS_OPEN_FAILED)
subversion/libsvn_client/ra.c:541: (apr_err=SVN_ERR_RA_LOCAL_REPOS_OPEN_FAILED)
subversion/libsvn_client/ra.c:393: (apr_err=SVN_ERR_RA_LOCAL_REPOS_OPEN_FAILED)
subversion/libsvn_ra/ra_loader.c:482:
(apr_err=SVN_ERR_RA_LOCAL_REPOS_OPEN_FAILED)
svn: E180001: Unable to connect to a repository at URL
'file:///home/cmpilato/tests/arch'
subversion/libsvn_ra_local/ra_plugin.c:578:
(apr_err=SVN_ERR_RA_LOCAL_REPOS_OPEN_FAILED)
svn: E180001: Unable to open an ra_local session to URL
subversion/libsvn_ra_local/split_url.c:46:
(apr_err=SVN_ERR_RA_LOCAL_REPOS_OPEN_FAILED)
svn: E180001: Unable to open repository 'file:///home/cmpilato/tests/arch'

Do this:

subversion/svn/checkout-cmd.c:168 (apr_err=180001)
subversion/libsvn_client/checkout.c:197 (apr_err=180001)
subversion/libsvn_client/checkout.c:100 (apr_err=180001)
subversion/libsvn_client/ra.c:541 (apr_err=180001)
subversion/libsvn_client/ra.c:393 (apr_err=180001)
subversion/libsvn_ra/ra_loader.c:482 (apr_err=180001)
svn: E180001: Unable to connect to a repository at URL
'file:///home/cmpilato/tests/arch'
subversion/libsvn_ra_local/ra_plugin.c:578 (apr_err=180001)
svn: E180001: Unable to open an ra_local session to URL
subversion/libsvn_ra_local/split_url.c:46 (apr_err=180001)
svn: E180001: Unable to open repository 'file:///home/cmpilato/tests/arch'
(E1800001 = SVN_ERR_RA_LOCAL_REPOS_OPEN_FAILED)

And in release mode:

svn: E180001: Unable to connect to a repository at URL
'file:///home/cmpilato/tests/arch'
svn: E180001: Unable to open an ra_local session to URL
svn: E180001: Unable to open repository 'file:///home/cmpilato/tests/arch'
(E1800001 = SVN_ERR_RA_LOCAL_REPOS_OPEN_FAILED)

Now, that's not a great example of multiple codes, but (using a fictional error
scenario) they'd be formatted like so (sorted numerically):

svn: E180003: Unable to connect to a repository at URL
'file:///home/cmpilato/tests/arch'
svn: E180012: Unable to open an ra_local session to URL
svn: E180001: Unable to open repository 'file:///home/cmpilato/tests/arch'
(E1800001 = SVN_ERR_RA_LOCAL_REPOS_OPEN_FAILED)
(E1800003 = SVN_ERR_SOMETHING_ELSE)
(E1800012 = SVN_ERR_YET_ANOTHER_FAILURE)

Thoughts?

-- 
C. Michael Pilato <cmpilato_at_collab.net>
CollabNet   <>   www.collab.net   <>   Enterprise Cloud Development

Received on 2013-04-12 20:35:01 CEST

This is an archived mail posted to the Subversion Dev mailing list.