anchor.diff:      [{control, Result}].
   
   force_replace(Node, Node1, Node2) ->
  -    try
  -        Response = remote(Node, riak_core_claimant, force_replace, [Node1, Node2]),
  -        case Response of
  -            ok ->
  -                [{control, [{success, ok}]}];
  -            {error, R} ->
  -                [{control, [{error, R}]}]
  -        end
  -    catch
  -        Exception:Reason ->
  -            Error = list_to_binary(io_lib:format("~p:~p", [Exception,Reason])),
  -            [{control, [{error, Error}]}]
  -    end.
  +    handle_error(fun () ->
  +                         Response = remote(Node, riak_core_claimant, force_replace, [Node1, Node2]),
  +                         case Response of
  +                             ok ->
  +                                 [{control, [{success, ok}]}];
  +                             {error, R} ->
  +                                 [{control, [{error, R}]}]
  +                         end
  +                 end).
   
   replace(Node, Node1, Node2) ->
       force_replace(Node, Node1, Node2),
  
positive.code:     end.
  
  transfers(Node) ->
      try
          {Down, Pending} = remote(Node, riak_core_status, transfers, []),
          F = fun({waiting_to_handoff, WaitingNode, Count}, {Waiting, Stopped}) ->
                      {[{WaitingNode, Count} | Waiting], Stopped};
                 ({stopped, StoppedNode, Count}, {Waiting, Stopped}) ->
                      {Waiting, [{StoppedNode, Count} | Stopped]}
          end,
          {Waiting, Stopped} = lists:foldl(F, {[], []}, Pending),
          {Xfers, Down} = remote(Node, riak_core_status, all_active_transfers, []),
          ActiveTransfers = [get_active_transfers(Xfer) || Xfer <- lists:flatten(Xfers)],
          [{control, [{down, Down},
                      {waiting_to_handoff, Waiting},
                      {stopped, Stopped},
                      {active, ActiveTransfers}]}]
      catch
          Exception:Reason ->
              Error = list_to_binary(io_lib:format("~p:~p", [Exception,Reason])),
              [{control, [{error, Error}]}]
      end.
  
  aae_status(Node) ->
      try
          ExchangeInfo = remote(Node, riak_kv_entropy_info, compute_exchange_info, []),
          Exchanges = [[{index, Index},
                        {last_ts, datetime_str(LastTS)},
                        {all_ts, datetime_str(AllTS)}] || {Index, LastTS, AllTS, _Repairs} <- ExchangeInfo],
          TreeInfo = remote(Node, riak_kv_entropy_info, compute_tree_info, []),
          Trees = [[{index, Index},
                    {built_ts, datetime_str(BuiltTS)}] || {Index, BuiltTS} <- TreeInfo],
          KeysRepaired = [[{index, Index},
                           {last, Last},
                           {max, Max},
                           {mean, Mean}] || {Index, _, _, {Last,_Min,Max,Mean}} <- ExchangeInfo],
          [{control, [{exchanges, Exchanges},
                      {entropy_trees, Trees},
                      {keys_repaired, KeysRepaired}]}]
      catch
          Exception:Reason ->
              Error = list_to_binary(io_lib:format("~p:~p", [Exception,Reason])),
              [{control, [{error, Error}]}]
      end.
  
  %%%===================================================================
  %%% Riak Client API
  
negative.code:         {down, Down}]}].
  
  ringready(Node) ->
      handle_error(fun () ->
                           Response = remote(Node, riak_core_status, ringready, []),
                           case Response of
                               {ok, Nodes} ->
                                   [{control, [{ready, true},{nodes, Nodes}]}];
                               {error, {different_owners, N1, N2}} ->
                                   [{control, [{ready, false},{error, [{different_owners, [N1, N2]}]}]}];
                               {error, {nodes_down, Down}} ->
                                   [{control, [{ready, false},{error, [{nodes_down, Down}]}]}]
                           end
                   end).
  
  datetime_str({_Mega, _Secs, _Micro}=Now) ->
      datetime_str(calendar:now_to_datetime(Now));
  