subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1554027 - in /subversion/trunk/subversion: include/svn_error_codes.h libsvn_ra/ra_loader.c libsvn_ra_local/ra_plugin.c
Date Sun, 29 Dec 2013 14:31:41 GMT
Author: rhuijben
Date: Sun Dec 29 14:31:41 2013
New Revision: 1554027

URL: http://svn.apache.org/r1554027
Log:
Tweak ra session open failure error generation to produce a localizable message
and use an easy to check code.

* subversion/include/svn_error_codes.h
  (SVN_ERR_RA_CANNOT_CREATE_SESSION): New error code.

* subversion/libsvn_ra/ra_loader.c
  (svn_ra_open4): Wrap provider specific error codes with generic error.
    Make message localizable.

* subversion/libsvn_ra_local/ra_plugin.c
  (svn_ra_local__open): Remove wrapping that has been in ra_loader.c for some
    versions to avoid duplicated error messages.

Modified:
    subversion/trunk/subversion/include/svn_error_codes.h
    subversion/trunk/subversion/libsvn_ra/ra_loader.c
    subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c

Modified: subversion/trunk/subversion/include/svn_error_codes.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_error_codes.h?rev=1554027&r1=1554026&r2=1554027&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_error_codes.h (original)
+++ subversion/trunk/subversion/include/svn_error_codes.h Sun Dec 29 14:31:41 2013
@@ -965,6 +965,11 @@ SVN_ERROR_START
              SVN_ERR_RA_CATEGORY_START + 12,
              "Can't create tunnel")
 
+  /** @since New in 1.9. */
+  SVN_ERRDEF(SVN_ERR_RA_CANNOT_CREATE_SESSION,
+             SVN_ERR_RA_CATEGORY_START + 13,
+             "Can't create session")
+
   /* ra_dav errors */
 
   SVN_ERRDEF(SVN_ERR_RA_DAV_SOCK_INIT,

Modified: subversion/trunk/subversion/libsvn_ra/ra_loader.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra/ra_loader.c?rev=1554027&r1=1554026&r2=1554027&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra/ra_loader.c (original)
+++ subversion/trunk/subversion/libsvn_ra/ra_loader.c Sun Dec 29 14:31:41 2013
@@ -267,6 +267,7 @@ svn_error_t *svn_ra_open4(svn_ra_session
   const char *server_group;
   apr_uri_t repos_URI;
   apr_status_t apr_err;
+  svn_error_t *err;
 #ifdef CHOOSABLE_DAV_MODULE
   const char *http_library = DEFAULT_HTTP_LIBRARY;
 #endif
@@ -477,10 +478,14 @@ svn_error_t *svn_ra_open4(svn_ra_session
   session->pool = sesspool;
 
   /* Ask the library to open the session. */
-  SVN_ERR_W(vtable->open_session(session, &corrected_url, repos_URL,
-                                 callbacks, callback_baton, config, sesspool),
-            apr_psprintf(pool, "Unable to connect to a repository at URL '%s'",
-                         repos_URL));
+  err = vtable->open_session(session, &corrected_url, repos_URL,
+                             callbacks, callback_baton, config, sesspool);
+
+  if (err)
+    return svn_error_createf(
+                SVN_ERR_RA_CANNOT_CREATE_SESSION, err,
+                _("Unable to connect to a repository at URL '%s'"),
+                repos_URL);
 
   /* If the session open stuff detected a server-provided URL
      correction (a 301 or 302 redirect response during the initial

Modified: subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c?rev=1554027&r1=1554026&r2=1554027&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c (original)
+++ subversion/trunk/subversion/libsvn_ra_local/ra_plugin.c Sun Dec 29 14:31:41 2013
@@ -575,12 +575,11 @@ svn_ra_local__open(svn_ra_session_t *ses
   /* Look through the URL, figure out which part points to the
      repository, and which part is the path *within* the
      repository. */
-  SVN_ERR_W(svn_ra_local__split_URL(&(sess->repos),
-                                    &(sess->repos_url),
-                                    &fs_path,
-                                    repos_URL,
-                                    session->pool),
-            _("Unable to open an ra_local session to URL"));
+  SVN_ERR(svn_ra_local__split_URL(&(sess->repos),
+                                  &(sess->repos_url),
+                                  &fs_path,
+                                  repos_URL,
+                                  session->pool));
   sess->fs_path = svn_stringbuf_create(fs_path, session->pool);
 
   /* Cache the filesystem object from the repos here for



Mime
View raw message