Skip to content

Commit

Permalink
Added basic case catch to the votes to catch error
Browse files Browse the repository at this point in the history
  • Loading branch information
auser committed Jul 7, 2010
1 parent eeed01a commit 0ea05a3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/gen_cluster.erl
Expand Up @@ -386,8 +386,11 @@ do_publish(Mod, Msg) ->

% Call vote
do_call_vote(Mod, Msg) ->
Votes = lists:map(fun(Pid) ->
Vote = gen_server:call(Pid, {'$gen_cluster', handle_vote_called, Msg}),
Votes = lists:map(fun(Pid) ->
Vote = case catch gen_server:call(Pid, {'$gen_cluster', handle_vote_called, Msg}) of
{'EXIT', _} -> 0;
E -> E
end,
{Pid, Vote}
end, gproc:lookup_pids({p,g,cluster_key(Mod)})),
[{WinnerPid, _WinnerVote}|_Rest] = lists:sort(fun({_Pid1, Vote1},{_Pid2, Vote2}) -> Vote1 > Vote2 end, Votes),
Expand Down

0 comments on commit 0ea05a3

Please sign in to comment.