Skip to content

Commit

Permalink
master: log crashes in handle_event for gen_listener (2600hz#4227)
Browse files Browse the repository at this point in the history
Conflicts:
	core/kazoo_amqp/src/gen_listener.erl
  • Loading branch information
mark2600 authored and k-anderson committed Sep 29, 2017
1 parent 40970a5 commit 3557d45
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions core/kazoo_amqp/src/gen_listener.erl
Original file line number Diff line number Diff line change
Expand Up @@ -915,11 +915,14 @@ callback_handle_event(JObj
handle_event_return() |
{'EXIT', any()}.
callback_handle_event(JObj, _, {Module, Fun, 2}, ModuleState) ->
catch Module:Fun(JObj, ModuleState);
try Module:Fun(JObj, ModuleState)
catch E:O -> lager:error("CRASH in handle_event ~p:~p", [E, O]) end;
callback_handle_event(JObj, {BasicDeliver, _}, {Module, Fun, 3}, ModuleState) ->
catch Module:Fun(JObj, BasicDeliver, ModuleState);
try Module:Fun(JObj, BasicDeliver, ModuleState)
catch E:O -> lager:error("CRASH in handle_event ~p:~p", [E, O]) end;
callback_handle_event(JObj, {BasicDeliver, Basic}, {Module, Fun, 4}, ModuleState) ->
catch Module:Fun(JObj, BasicDeliver, Basic, ModuleState);
try Module:Fun(JObj, BasicDeliver, Basic, ModuleState)
catch E:O -> lager:error("CRASH in handle_event ~p:~p", [E, O]) end;
callback_handle_event(_, _, _, _) ->
{'EXIT', 'not_exported'}.

Expand Down

0 comments on commit 3557d45

Please sign in to comment.