Skip to content
Browse files

fix consumer_died error

  • Loading branch information...
1 parent 7195c30 commit 6cd8c68649a197334a8514bfd8720b758c71638a Vladimir Baranov committed with jlouis
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/amqp_gen_consumer.erl
View
6 src/amqp_gen_consumer.erl
@@ -229,8 +229,10 @@ handle_call({consumer_call, Method, Args}, _From,
case Return of
{ok, NewMState} ->
{reply, ok, State#state{module_state = NewMState}};
+ {error, {consumer_died, Reason}, NewMState} ->
+ {stop, Reason, State#state{module_state = NewMState}};
{error, Reason, NewMState} ->
- {stop, {error, Reason}, {error, Reason},
+ {stop, {error, Reason},
State#state{module_state = NewMState}}
end.
@@ -242,6 +244,8 @@ handle_info(Info, State = #state{module_state = MState,
case ConsumerModule:handle_info(Info, MState) of
{ok, NewMState} ->
{noreply, State#state{module_state = NewMState}};
+ {error, {consumer_died, Reason}, NewMState} ->
+ {stop, Reason, State#state{module_state = NewMState}};
{error, Reason, NewMState} ->
{stop, {error, Reason}, State#state{module_state = NewMState}}
end.

0 comments on commit 6cd8c68

Please sign in to comment.
Something went wrong with that request. Please try again.