diff options
| author | Emile Joubert <emile@rabbitmq.com> | 2011-01-10 13:57:21 +0000 |
|---|---|---|
| committer | Emile Joubert <emile@rabbitmq.com> | 2011-01-10 13:57:21 +0000 |
| commit | f7d16db3692dd143ac535e3f7c6ed1435286436d (patch) | |
| tree | 27c0d4f3c3ccf50966a44f003eb5c7e952d06420 | |
| parent | f5bdd1e1839365f566346f6c687a0c362d3a5546 (diff) | |
| download | rabbitmq-server-git-f7d16db3692dd143ac535e3f7c6ed1435286436d.tar.gz | |
Unconditionally return a fun() in execute mnesia tx
| -rw-r--r-- | src/rabbit_binding.erl | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/rabbit_binding.erl b/src/rabbit_binding.erl index aad501ba3f..f667ab4005 100644 --- a/src/rabbit_binding.erl +++ b/src/rabbit_binding.erl @@ -297,13 +297,17 @@ sync_binding(Binding, Durable, Fun) -> call_with_source_and_destination(SrcName, DstName, Fun) -> SrcTable = table_for_resource(SrcName), DstTable = table_for_resource(DstName), + ErrFun = fun (Err) -> + fun (_Tx) -> Err end + end, rabbit_misc:execute_mnesia_tx_with_tail( fun () -> case {mnesia:read({SrcTable, SrcName}), mnesia:read({DstTable, DstName})} of {[Src], [Dst]} -> Fun(Src, Dst); - {[], [_] } -> {error, source_not_found}; - {[_], [] } -> {error, destination_not_found}; - {[], [] } -> {error, source_and_destination_not_found} + {[], [_] } -> ErrFun({error, source_not_found}); + {[_], [] } -> ErrFun({error, destination_not_found}); + {[], [] } -> + ErrFun({error, source_and_destination_not_found}) end end). |
