You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by va...@apache.org on 2020/08/20 20:27:01 UTC
[couchdb] branch prototype/fdb-layer updated: Do not use (catch
...) in couch_views_reader:load_docs/4
This is an automated email from the ASF dual-hosted git repository.
vatamane pushed a commit to branch prototype/fdb-layer
in repository https://gitbox.apache.org/repos/asf/couchdb.git
The following commit(s) were added to refs/heads/prototype/fdb-layer by this push:
new 452ce75 Do not use (catch ...) in couch_views_reader:load_docs/4
452ce75 is described below
commit 452ce75350de652a462a9c633844cfb37672fda1
Author: Nick Vatamaniuc <va...@apache.org>
AuthorDate: Thu Aug 20 15:36:38 2020 -0400
Do not use (catch ...) in couch_views_reader:load_docs/4
Any error there would just be generating a case clause.
Remove the `{not_found, missing}` clause since it was accidentally matching on
the Rev string and the case was included in the `_Else` clause anyway.
---
src/couch_views/src/couch_views_reader.erl | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/couch_views/src/couch_views_reader.erl b/src/couch_views/src/couch_views_reader.erl
index ce7f163..61a78d7 100644
--- a/src/couch_views/src/couch_views_reader.erl
+++ b/src/couch_views/src/couch_views_reader.erl
@@ -210,8 +210,7 @@ load_doc(TxDb, Id, null, DocOpts) ->
load_doc(TxDb, Id, Rev, DocOpts) ->
Rev1 = couch_doc:parse_rev(Rev),
- case (catch fabric2_db:open_doc_revs(TxDb, Id, [Rev1], DocOpts)) of
+ case fabric2_db:open_doc_revs(TxDb, Id, [Rev1], DocOpts) of
{ok, [{ok, Doc}]} -> couch_doc:to_json_obj(Doc, DocOpts);
- {ok, [{{not_found, missing}, Rev}]} -> null;
{ok, [_Else]} -> null
end.