anchor.diff:              true ->
                   ok;
               false ->
  -                [gen_server:cast(Server, {resume_scan, ShardName})
  -                    || ShardName <- replicator_shards(DbName)],
  -                ok
  +                try
  +                    [gen_server:cast(Server, {resume_scan, ShardName})
  +                        || ShardName <- replicator_shards(DbName)]
  +                catch error:database_does_not_exist ->
  +                    ok
  +                end
               end
           end;
           (_, _) -> ok
  
positive.code:     end.
  
  open_rep_doc(DbName, DocId) ->
      {ok, Db} = couch_db:open_int(DbName, [?CTX, sys_db]),
      try
          couch_db:open_doc(Db, DocId, [ejson_body])
      after
          couch_db:close(Db)
      end.
  
  save_rep_doc(DbName, Doc) ->
  
negative.code: 
  ensure_rep_ddoc_exists(RepDb, DDocId) ->
      case open_rep_doc(RepDb, DDocId) of
          {not_found, no_db_file} ->
              %% database was deleted.
              ok;
          {not_found, _Reason} ->
              {ok, DDoc} = replication_design_doc(DDocId),
              couch_log:notice("creating replicator ddoc", []),
  