From c885a2a5ae2a88b54447666fc0c5daf51882afb9 Mon Sep 17 00:00:00 2001 From: Vitaly Shutko Date: Mon, 21 Sep 2015 16:06:50 +0300 Subject: [PATCH] add class/term to error message --- src/mqs_worker.erl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mqs_worker.erl b/src/mqs_worker.erl index 010652c..6199a35 100644 --- a/src/mqs_worker.erl +++ b/src/mqs_worker.erl @@ -93,11 +93,11 @@ handle_info({#'basic.deliver'{delivery_tag = Tag}, Message}, State) -> Mod = Spec#mqs.'mod', Fun = Spec#mqs.'fun', InvokeResult = try Mod:Fun({Payload,Spec#mqs.arg,Props}) - catch _:_ -> {error, msg_callback_failed, erlang:get_stacktrace()} end, + catch C:T -> {error, msg_callback_failed, {C,T,erlang:get_stacktrace()}} end, case InvokeResult of {ok, _} -> amqp_channel:cast(State#state.channel,#'basic.ack'{delivery_tag=Tag}); - {error, Reason, Stacktrace} -> - mqs:error(?MODULE,"Error while processing received message. Reason: ~p~nStacktrace: ~p", [Reason, Stacktrace]), + {error, Reason, Info} -> + mqs:error(?MODULE,"Error while processing received message. Reason: ~p~nDetails: ~p~n", [Reason, Info]), amqp_channel:cast(State#state.channel,#'basic.reject'{delivery_tag=Tag,requeue=true}); Res -> mqs:warning(?MODULE,"Unknown message processing result ~p~n",[Res]), amqp_channel:cast(State#state.channel,#'basic.reject'{delivery_tag=Tag,requeue=true}) end,