diff options
| author | Matthias Radestock <matthias@rabbitmq.com> | 2011-04-09 00:15:52 +0100 |
|---|---|---|
| committer | Matthias Radestock <matthias@rabbitmq.com> | 2011-04-09 00:15:52 +0100 |
| commit | 043369e89c9ad3090fca99b9c9df97a1aff5ef4a (patch) | |
| tree | 974dd07ef005067cb2bc53d59489da19f2428e42 /src | |
| parent | 0e8c9dabdb681e52e9f814428c1a44ad9cbf681b (diff) | |
| download | rabbitmq-server-git-043369e89c9ad3090fca99b9c9df97a1aff5ef4a.tar.gz | |
tiny refactor
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_binding.erl | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/rabbit_binding.erl b/src/rabbit_binding.erl index 0fb0639a3d..b0a59a0cd0 100644 --- a/src/rabbit_binding.erl +++ b/src/rabbit_binding.erl @@ -281,17 +281,16 @@ sync_transient_binding(Binding, Fun) -> call_with_source_and_destination(SrcName, DstName, Fun) -> SrcTable = table_for_resource(SrcName), DstTable = table_for_resource(DstName), - ErrFun = fun (Err) -> rabbit_misc:const(Err) end, + ErrFun = fun (Err) -> rabbit_misc:const({error, Err}) end, rabbit_misc:execute_mnesia_tx_with_tail( fun () -> case {mnesia:read({SrcTable, SrcName}), mnesia:read({DstTable, DstName})} of {[Src], [Dst]} -> Fun(Src, Dst); - {[], [_] } -> ErrFun({error, source_not_found}); - {[_], [] } -> ErrFun({error, destination_not_found}); - {[], [] } -> ErrFun({error, - source_and_destination_not_found}) - end + {[], [_] } -> ErrFun(source_not_found); + {[_], [] } -> ErrFun(destination_not_found); + {[], [] } -> ErrFun(source_and_destination_not_found) + end end). table_for_resource(#resource{kind = exchange}) -> rabbit_exchange; |
