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

Re: Consistent error codes from RA layers

From: C. Michael Pilato <cmpilato_at_collab.net>
Date: Thu, 06 Mar 2008 08:12:05 -0500

Julian Foad wrote:
> Code like this appears in several places:
> > err = editor->delete_entry(path, item->revision, parent_baton, pool);
> > if (err)
> > {
> > if (err->apr_err == SVN_ERR_FS_NOT_FOUND
> > || err->apr_err == SVN_ERR_RA_DAV_PATH_NOT_FOUND)
> These two errors both mean "the item was not present in the repository".
> When committing to the repository, this indicates that the WC is out of
> date w.r.t. the repository.
> SVN_ERR_FS_NOT_FOUND is sent by the file or svn RA layers, and
> SVN_ERR_RA_DAV_PATH_NOT_FOUND is sent by the http/https RA layers, with
> the same meaning.
> The RA layers are intended to provide a consistent interface, so I think
> all the RA layers ought to be made to return the same error code for
> this case.
> At the very least, svn_delta_editor_t ought to document the error codes
> that its functions return in this and similar situations.
> Opinions?


I've expressed in the past my belief that we do far too much naive
propagation of errors up the stack, and not enough coalescing of errors into
a relatively small set of well-documented ones that callers can test against.

C. Michael Pilato <cmpilato_at_collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand

Received on 2008-03-06 16:39:43 CET

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