summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Avdey <eiri@eiri.ca>2019-02-14 15:56:39 -0400
committerEric Avdey <eiri@eiri.ca>2019-02-15 21:45:04 -0400
commit5df22607c6b7a97367ec8b1d07fd748d6b8e8989 (patch)
treefc1b2ce1f88ba3ccd987693154f0d379eccc605e
parentc8f5058fc309aa80869235a6cc760067cb9166b3 (diff)
downloadcouchdb-5df22607c6b7a97367ec8b1d07fd748d6b8e8989.tar.gz
Unwrap double try...catch in split/3
-rw-r--r--src/couch/src/couch_db_split.erl13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/couch/src/couch_db_split.erl b/src/couch/src/couch_db_split.erl
index c459fdac2..dc5a5f77c 100644
--- a/src/couch/src/couch_db_split.erl
+++ b/src/couch/src/couch_db_split.erl
@@ -61,14 +61,11 @@ split(Source, #{} = Targets, PickFun) when is_function(PickFun, 3) ->
Partitioned = couch_db:is_partitioned(SourceDb),
HashFun = mem3_hash:get_hash_fun(couch_db:name(SourceDb)),
try
- try
- split(SourceDb, Partitioned, Engine, Targets, PickFun,
- HashFun)
- catch
- throw:{target_create_error, DbName, Error, TargetDbs} ->
- cleanup_targets(TargetDbs, Engine),
- {error, {target_create_error, DbName, Error}}
- end
+ split(SourceDb, Partitioned, Engine, Targets, PickFun, HashFun)
+ catch
+ throw:{target_create_error, DbName, Error, TargetDbs} ->
+ cleanup_targets(TargetDbs, Engine),
+ {error, {target_create_error, DbName, Error}}
after
couch_db:close(SourceDb)
end;