summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@lshift.net>2010-04-28 12:41:09 +0100
committerSimon MacMullen <simon@lshift.net>2010-04-28 12:41:09 +0100
commitb54e1b37f2a0b168fe0c4add73c49ca9dfa48e6d (patch)
tree3f44468fcd9281511d440d00842be26a4c6011d7
parented59c8af0c29c90c8310c621555965c88d534d10 (diff)
downloadrabbitmq-server-b54e1b37f2a0b168fe0c4add73c49ca9dfa48e6d.tar.gz
Always catch, don't ever allow the server process to die.
-rw-r--r--src/delegate.erl5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/delegate.erl b/src/delegate.erl
index 88abb20b..5ed70351 100644
--- a/src/delegate.erl
+++ b/src/delegate.erl
@@ -142,6 +142,9 @@ server(Hash) ->
list_to_atom("delegate_process_" ++ integer_to_list(Hash)).
safe_invoke(FPid, Pid) ->
+ % We need the catch here for the local case. In the remote case there will
+ % already have been a catch in handle_ca{ll,st} below, but that's OK, catch
+ % is idempotent.
case catch FPid(Pid) of
{'EXIT', Reason} ->
{error, {'EXIT', Reason}, Pid};
@@ -158,7 +161,7 @@ init([]) ->
{ok, no_state}.
handle_call({thunk, Thunk}, _From, State) ->
- {reply, Thunk(), State}.
+ {reply, catch Thunk(), State}.
handle_cast({thunk, Thunk}, State) ->
catch Thunk(),