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

Re: SVN (numeric) error codes

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Tue, 26 Oct 2010 13:34:46 +0200

Jason Heeris wrote on Tue, Oct 26, 2010 at 11:51:16 +0800:
> 1. Is there a list of these error codes anywhere? The only thing
> I've found is the documentation for a header file[2], which is not
> hugely helpful.

That header file is the canonical documentation. Some functions
document the error codes they return on some possible error condition,
but that's all. Basically, if you don't find the documentation in any
of the public header files, then you'll have to read the source.

Tangentially, I've been wondering at times whether a macro such as the
following:

        #define svn_error_category(err) \
                ((err) ? ((err)->apr_err / SVN_ERR_CATEGORY_SIZE) * SVN_ERR_CATEGORY_SIZE : APR_SUCCESS)

        svn_error_t *err = (...);
        apr_status_t category = svn_error_category(err);
        if (err && err->apr_err == SVN_ERR_WC_CATEGORY_START)
                /* local error */;
        else if (err && err->apr_err == SVN_ERR_REPOS_CATEGORY_START)
                /* server-side error */;
        else if (err && err->apr_err == SVN_ERR_FS_CATEGORY_START)
                /* Uh-oh. */;
        else if (err && err->apr_err == SVN_ERR_SVNDIFF_CATEGORY_START)
                /* But I thought YOU made the backups! */;
        else
                ...

would be useful. (I first thought of this while reading
svn_error_malfunction_handler_t's docstring.) Opinions? Use cases?

Also, there is a script, which-error.py, in ^/subversion/trunk/tools,
which converts a numeric error code into a symbolic one.

> 2. Will the error codes remain consistent with future versions of SVN?
>

Yes, any code that has appeared in a release will be stable across all
1.x versions.

> [1] http://pysvn.tigris.org/docs/pysvn_prog_ref.html#pysvn_clienterror
> [2] http://svn.collab.net/svn-doxygen/svn__error__codes_8h.html
>
> Thanks,
> Jason
>
> (Please CC me on replies.)
Received on 2010-10-26 13:37:38 CEST

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.