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

svn_error_create(SERF_ERROR_FOO, NULL, NULL);

From: Daniel Shahaf <danielsh_at_elego.de>
Date: Tue, 28 May 2013 10:42:17 +0300

Just got a report of a problem with 1.8.0-rc2:

    svn: E120104: ra_serf: An error occurred during decompression

The error code is unrecognised; that's because it's not an SVN_ERR_* code:

    % ./tools/dev/which-error.py E120104
    00120104 *** UNKNOWN ERROR CODE ***
    % ./tools/dev/which-error.py E120000
    00120000 APR_OS_START_USERERR
    % grep -B 1 -w 4 -h /usr/local/serf-1.2.0/serf-1/include/*
    #define SERF_ERROR_DECOMPRESSION_FAILED (APR_OS_START_USERERR + \
                                                 SERF_ERROR_RANGE + 4)

The problem is that svn_ra_serf__wrap_err() passes a serf error code to
svn_error_create(). That's a problem, as API consumers won't be able to
make sense of the code: it's not in any SVN_ERROR_*_CATEGORY_START
category, svn_strerror() and svn_error_symbolic_name() will reject it,
etc.

I am not sure what to do instead. Maybe we define an
SVN_ERROR_SERF_ERROR error number and map all serf error numbers to it.
Maybe we define a few more of those for specific common serf errors, too
(like we do for sqlite). Maybe we just reserve [APR_OS_START_USERERR
+ 100, APR_OS_START_USERERR + 199] to serf error codes.

Thoughts?
Received on 2013-05-28 09:43:04 CEST

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