diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2010-07-08 16:58:03 +0100 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2010-07-08 16:58:03 +0100 |
| commit | e93b8f218dfeb98b668ba89bc9a411fdb6a1e7ae (patch) | |
| tree | 9c5dda3f8cd8213a2803998565ba6702fbc32984 | |
| parent | 99571554b451a205505265fdcbfb73444deecdb7 (diff) | |
| download | rabbitmq-server-git-e93b8f218dfeb98b668ba89bc9a411fdb6a1e7ae.tar.gz | |
Fix type of inner_fun, cosmetics.
| -rw-r--r-- | src/rabbit_channel.erl | 5 | ||||
| -rw-r--r-- | src/rabbit_exchange.erl | 14 |
2 files changed, 11 insertions, 8 deletions
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl index 651a28c807..a41b6ffbde 100644 --- a/src/rabbit_channel.erl +++ b/src/rabbit_channel.erl @@ -911,8 +911,7 @@ binding_action(Fun, ExchangeNameBin, QueueNameBin, RoutingKey, Arguments, check_read_permitted(ExchangeName, State), case Fun(ExchangeName, QueueName, ActualRoutingKey, Arguments, fun (_X, Q) -> - try - rabbit_amqqueue:check_exclusive_access(Q, ReaderPid) + try rabbit_amqqueue:check_exclusive_access(Q, ReaderPid) catch exit:Reason -> {error, Reason} end end) of @@ -929,7 +928,7 @@ binding_action(Fun, ExchangeNameBin, QueueNameBin, RoutingKey, Arguments, not_found, "no binding ~s between ~s and ~s", [RoutingKey, rabbit_misc:rs(ExchangeName), rabbit_misc:rs(QueueName)]); - %% When check_exclusive_access exits with a protocal error this gets + %% When check_exclusive_access exits with a protocol error this gets %% wrapped by mnesia. Unwrap it and exit again. {error, {amqp_error, _, _, _} = Error} -> exit(Error); diff --git a/src/rabbit_exchange.erl b/src/rabbit_exchange.erl index 9c0efe9459..d91ebe9ba9 100644 --- a/src/rabbit_exchange.erl +++ b/src/rabbit_exchange.erl @@ -64,8 +64,9 @@ -type(bind_res() :: rabbit_types:ok_or_error('queue_not_found' | 'exchange_not_found' | 'exchange_and_queue_not_found')). --type(inner_fun() :: fun((rabbit_types:exchange(), queue()) -> - rabbit_types:ok_or_error('amqp_error'))). +-type(inner_fun() :: + fun((rabbit_types:exchange(), queue()) -> + rabbit_types:ok_or_error(rabbit_types:amqp_error()))). -spec(recover/0 :: () -> 'ok'). -spec(declare/5 :: @@ -440,7 +441,8 @@ add_binding(ExchangeName, QueueName, RoutingKey, Arguments, InnerFun) -> [_R] -> {existing, X, B} end; - {error, _} = E -> E + {error, _} = E -> + E end end) of {new, Exchange = #exchange{ type = Type }, Binding} -> @@ -457,7 +459,8 @@ delete_binding(ExchangeName, QueueName, RoutingKey, Arguments, InnerFun) -> fun (X, Q, B) -> case mnesia:match_object(rabbit_route, #route{binding = B}, write) of - [] -> {error, binding_not_found}; + [] -> + {error, binding_not_found}; _ -> case InnerFun(X, Q) of ok -> @@ -467,7 +470,8 @@ delete_binding(ExchangeName, QueueName, RoutingKey, Arguments, InnerFun) -> Q#amqqueue.durable, fun mnesia:delete_object/3), {maybe_auto_delete(X), B}; - {error, _} = E -> E + {error, _} = E -> + E end end end) of |
