What happens if I accidentally specify a URL that's not a repository? (Recent trunk build, Neon.)
> $ svn checkout https://svn.apache.org/repos/ > svn: OPTIONS of 'https://svn.apache.org/repos': 200 OK > (https://svn.apache.org) This is a truly awful error message, appearing alone as it does. Google reveals that many users have spent hours trying to track down the cause of such errors. They appear in all repository operations, not just checkout. For example, <http://forum.joomla.org/viewtopic.php?f=406&t=205587> (during import; unresolved) and <http://stackoverflow.com/questions/1025377/an-svn-error-200-ok-when-checking-out-from-my-online-repo> (during checkout; SSH credentials not provided). What do we need to do? Two things, I think: 1. That low-level error report needs to be better. Any low-level function that regards a "200 OK" response as an error must not just create an error object saying "200 OK" alone but must wrap or replace that with an error message that indicates what it was trying to do and why an "OK" response is wrong. 2. Each high level operation should aim to wrap any error from a low-level function call with a higher-level explanation. For example, "checkout" subcommand should wrap any error with "failed to check out URL 'xxx'". It should not assume the low-level error provides enough information. It should mention the high-level object (e.g. path or URL) that failed so that the user can distinguish it within a batch of mostly successful attempts. The attached patch implements an instance of (2.) at the level of connecting to a repository - svn_ra_open3(). It expands the above quoted error to: > $ svn checkout https://svn.apache.org/repos/ > svn: Unable to connect to a repository at URL 'https://svn.apache.org/repos' > svn: OPTIONS of 'https://svn.apache.org/repos': 200 OK > (https://svn.apache.org) The corresponding errors with svn: and file: URLs are then: > $ svn checkout svn://localhost/repos > svn: Unable to connect to a repository at URL 'svn://localhost/repos' > svn: Can't connect to host 'localhost': Connection refused > $ svn checkout file://localhost/repos > svn: Unable to connect to a repository at URL 'file://localhost/repos' > svn: Unable to open an ra_local session to URL > svn: Unable to open repository 'file://localhost/repos' There is now a little redundancy in the RA-local error. I think that is acceptable and overall better than the previous situation. It passes tests. I'll comit in a day or two if no objections. - Julian
On failure to connect to the repository, give a consistent and readable error message. This particularly helps in cases where the error message from the specific RA layer is poor, such as RA-Neon's "200 OK" error message. * subversion/libsvn_ra/ra_loader.c (svn_ra_open3): Wrap any error returned from the open_session() method. --This line, and those below, will be ignored-- Index: subversion/libsvn_ra/ra_loader.c =================================================================== --- subversion/libsvn_ra/ra_loader.c (revision 897042) +++ subversion/libsvn_ra/ra_loader.c (working copy) @@ -482,8 +482,10 @@ svn_error_t *svn_ra_open3(svn_ra_session session->pool = pool; /* Ask the library to open the session. */ - SVN_ERR(vtable->open_session(session, repos_URL, callbacks, callback_baton, - config, pool)); + SVN_ERR_W(vtable->open_session(session, repos_URL, callbacks, callback_baton, + config, pool), + apr_psprintf(pool, "Unable to connect to a repository at URL '%s'", + repos_URL)); /* Check the UUID. */ if (uuid)