diff options
author | Matthias Radestock <matthias@lshift.net> | 2008-10-13 21:37:02 +0100 |
---|---|---|
committer | Matthias Radestock <matthias@lshift.net> | 2008-10-13 21:37:02 +0100 |
commit | 6f68e9927c66c40b9699223b7d493f6492a95920 (patch) | |
tree | 0462a3c841e2397777d35620a9b5e10bff6ae9d3 | |
parent | ba42dc1a68bf72d8bac6ee5cd46d2855c10fb2fc (diff) | |
download | rabbitmq-server-6f68e9927c66c40b9699223b7d493f6492a95920.tar.gz |
exit with a proper protocol error when commit/rollback fail
-rw-r--r-- | src/rabbit_channel.erl | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl index a9278898..ef3a9f0e 100644 --- a/src/rabbit_channel.erl +++ b/src/rabbit_channel.erl @@ -717,7 +717,8 @@ internal_commit(State = #ch{transaction_id = TxnKey, case rabbit_amqqueue:commit_all(sets:to_list(Participants), TxnKey) of ok -> new_tx(State); - {error, Errors} -> exit({commit_failed, Errors}) + {error, Errors} -> rabbit_misc:protocol_error( + internal_error, "commit failed: ~w", [Errors]) end. internal_rollback(State = #ch{transaction_id = TxnKey, @@ -732,7 +733,8 @@ internal_rollback(State = #ch{transaction_id = TxnKey, TxnKey) of ok -> NewUAMQ = queue:join(UAQ, UAMQ), new_tx(State#ch{unacked_message_q = NewUAMQ}); - {error, Errors} -> exit({rollback_failed, Errors}) + {error, Errors} -> rabbit_misc:protocol_error( + internal_error, "rollback failed: ~w", [Errors]) end. fold_per_queue(F, Acc0, UAQ) -> |