iilyak commented on a change in pull request #538: Catch Database Do Not Exist
Error
URL: https://github.com/apache/couchdb/pull/538#discussion_r119734074
##########
File path: src/mem3/src/mem3_sync_security.erl
##########
@@ -44,10 +44,20 @@ maybe_sync_int(#shard{name=Name}=Src, Dst) ->
go() ->
{ok, Dbs} = fabric:all_dbs(),
- lists:foreach(fun handle_db/1, Dbs).
+ lists:foreach(fun handle_existing_db/1, Dbs).
go(DbName) when is_binary(DbName) ->
- handle_db(DbName).
+ handle_existing_db(DbName).
+
+handle_existing_db(DbName) ->
+ try handle_db(DbName) of
+ _ -> ok
+ catch
+ error:database_does_not_exist->
+ couch_log:error("Db was deleted while getting security"
Review comment:
Does it have to be an error? Would the following work?:
`couch_log:info("Skipping deleted database '~p' while syncing security
object", [DbName])`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services