couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chewbra...@apache.org
Subject [2/5] couchdb-cassim git commit: Handle deleted and other unexpected responses
Date Thu, 21 May 2015 21:32:49 GMT
Handle deleted and other unexpected responses


Project: http://git-wip-us.apache.org/repos/asf/couchdb-cassim/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-cassim/commit/e67d7ee6
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-cassim/tree/e67d7ee6
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-cassim/diff/e67d7ee6

Branch: refs/heads/master
Commit: e67d7ee66ba49e027e1a20c140499b3b15ccda09
Parents: 0c3f045
Author: Russell Branca <chewbranca@apache.org>
Authored: Thu Apr 23 23:45:28 2015 +0000
Committer: Russell Branca <chewbranca@apache.org>
Committed: Thu Apr 23 23:45:28 2015 +0000

----------------------------------------------------------------------
 src/cassim_metadata_cache.erl | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-cassim/blob/e67d7ee6/src/cassim_metadata_cache.erl
----------------------------------------------------------------------
diff --git a/src/cassim_metadata_cache.erl b/src/cassim_metadata_cache.erl
index b6ad486..12f2a06 100644
--- a/src/cassim_metadata_cache.erl
+++ b/src/cassim_metadata_cache.erl
@@ -195,17 +195,25 @@ load_meta_from_db(DbName, MetaId) ->
     Args = [DbName, MetaId, []],
     Timeout = cache_timeout(),
     case couch_util:with_proc(fabric, open_doc, Args, Timeout) of
-        {ok, {ok, Doc}} ->
+        {ok, {ok, #doc{}=Doc}} ->
             couch_doc:to_json_obj(Doc, []);
+        {ok, {not_found, deleted}} ->
+            deleted;
         {ok, {not_found, missing}} ->
             undefined;
         {error, {database_does_not_exist, _}} ->
             undefined;
         {error, timeout} ->
-            couch_log:notice("timeout retrieving metadata doc ~s", [MetaId]),
+            couch_log:notice(
+                "timeout retrieving metadata doc [~s/]~s",
+                [DbName, MetaId]
+            ),
             {error, timeout};
-        {error, Error} ->
-            {error, Error}
+        Resp ->
+            couch_log:notice(
+                "unexpected response retrieving metadata doc [~s/]~s: ~s",
+                [DbName, MetaId, Resp]),
+            {error, Resp}
      end.
 
 


Mime
View raw message