From 91014e9a0e590390f69a8b525e0043a58e6d2241 Mon Sep 17 00:00:00 2001 From: Matthew Sackman Date: Mon, 7 Feb 2011 16:50:11 +0000 Subject: Make with_exit_handler more robust and able to cope with the other forms of shutdown and nodedown --- src/rabbit_misc.erl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/rabbit_misc.erl b/src/rabbit_misc.erl index 7d916797..e36b1dd1 100644 --- a/src/rabbit_misc.erl +++ b/src/rabbit_misc.erl @@ -350,8 +350,11 @@ throw_on_error(E, Thunk) -> with_exit_handler(Handler, Thunk) -> try Thunk() - catch exit:{R, _} when R =:= noproc; R =:= nodedown; - R =:= normal; R =:= shutdown -> + catch + exit:{R, _} when R =:= noproc; R =:= nodedown; + R =:= normal; R =:= shutdown -> + Handler(); + exit:{{R, _}, _} when R =:= nodedown; R =:= shutdown -> Handler() end. -- cgit v1.2.1