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.)

Reply via email to