couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fdman...@apache.org
Subject svn commit: r985769 - /couchdb/branches/new_replicator/src/couchdb/couch_replicate.erl
Date Sun, 15 Aug 2010 22:47:51 GMT
Author: fdmanana
Date: Sun Aug 15 22:47:51 2010
New Revision: 985769

URL: http://svn.apache.org/viewvc?rev=985769&view=rev
Log:
Catch any error during replication gen_server initialization and avoid errors
when JSON encoding arbitrary server crash reasons.

Modified:
    couchdb/branches/new_replicator/src/couchdb/couch_replicate.erl

Modified: couchdb/branches/new_replicator/src/couchdb/couch_replicate.erl
URL: http://svn.apache.org/viewvc/couchdb/branches/new_replicator/src/couchdb/couch_replicate.erl?rev=985769&r1=985768&r2=985769&view=diff
==============================================================================
--- couchdb/branches/new_replicator/src/couchdb/couch_replicate.erl (original)
+++ couchdb/branches/new_replicator/src/couchdb/couch_replicate.erl Sun Aug 15 22:47:51 2010
@@ -112,7 +112,9 @@ start_replication({BaseId, Extension} = 
         ?LOG_DEBUG("replication ~p already running at ~p", [RepChildId, Pid]),
         Pid;
     {error, {{db_not_found, DbUrl}, _}} ->
-        throw({db_not_found, <<"could not open ", DbUrl/binary>>})
+        throw({db_not_found, <<"could not open ", DbUrl/binary>>});
+    {error, Error} ->
+        throw({error, Error})
     end,
     {ok, RepPid}.
 
@@ -141,7 +143,7 @@ wait_for_result(RepId, Listener, Retries
             wait_for_result(RepId, Listener, RetriesLeft - 1);
         false ->
             couch_replication_notifier:stop(Listener),
-            {error, Reason}
+            {error, couch_util:to_binary(Reason)}
         end
     end.
 



Mime
View raw message