summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/rabbit_channel.erl15
-rw-r--r--src/rabbit_exchange.erl2
-rw-r--r--src/rabbit_router.erl4
3 files changed, 7 insertions, 14 deletions
diff --git a/src/rabbit_channel.erl b/src/rabbit_channel.erl
index 089550ba9d..078c160265 100644
--- a/src/rabbit_channel.erl
+++ b/src/rabbit_channel.erl
@@ -259,10 +259,7 @@ expand_routing_key_shortcut(_QueueNameBin, RoutingKey, _State) ->
RoutingKey.
die_precondition_failed(Fmt, Params) ->
- %% FIXME: 406 should be replaced with precondition_failed when we
- %% move to AMQP spec >=8.1
- rabbit_misc:protocol_error({false, 406, <<"PRECONDITION_FAILED">>},
- Fmt, Params).
+ rabbit_misc:protocol_error(precondition_failed, Fmt, Params).
%% check that an exchange/queue name does not contain the reserved
%% "amq." prefix.
@@ -774,14 +771,10 @@ deliver(QPids, Mandatory, Immediate, Txn, Message, WriterPid) ->
case rabbit_router:deliver(QPids, Mandatory, Immediate, Txn, Message) of
{ok, DeliveredQPids} -> DeliveredQPids;
{error, unroutable} ->
- %% FIXME: 312 should be replaced by the ?NO_ROUTE
- %% definition, when we move to >=0-9
- ok = basic_return(Message, WriterPid, 312, <<"unroutable">>),
+ ok = basic_return(Message, WriterPid, ?NO_ROUTE, <<"unroutable">>),
[];
- {error, not_delivered} ->
- %% FIXME: 313 should be replaced by the ?NO_CONSUMERS
- %% definition, when we move to >=0-9
- ok = basic_return(Message, WriterPid, 313, <<"not_delivered">>),
+ {error, no_consumers} ->
+ ok = basic_return(Message, WriterPid, ?NO_CONSUMERS, <<"no_consumers">>),
[]
end.
diff --git a/src/rabbit_exchange.erl b/src/rabbit_exchange.erl
index 7ce6949da3..c523eda3c0 100644
--- a/src/rabbit_exchange.erl
+++ b/src/rabbit_exchange.erl
@@ -58,7 +58,7 @@
-ifdef(use_specs).
-type(publish_res() :: {'ok', [pid()]} |
- not_found() | {'error', 'unroutable' | 'not_delivered'}).
+ not_found() | {'error', 'unroutable' | 'no_consumers'}).
-type(bind_res() :: 'ok' |
{'error', 'queue_not_found' | 'exchange_not_found'}).
-spec(recover/0 :: () -> 'ok').
diff --git a/src/rabbit_router.erl b/src/rabbit_router.erl
index 0b06a063a7..afc534f9d4 100644
--- a/src/rabbit_router.erl
+++ b/src/rabbit_router.erl
@@ -51,7 +51,7 @@
-spec(start_link/0 :: () -> {'ok', pid()} | 'ignore' | {'error', any()}).
-spec(deliver/5 :: ([pid()], bool(), bool(), maybe(txn()), message()) ->
- {'ok', [pid()]} | {'error', 'unroutable' | 'not_delivered'}).
+ {'ok', [pid()]} | {'error', 'unroutable' | 'no_consumers'}).
-endif.
@@ -180,5 +180,5 @@ run_bindings(QPids, IsMandatory, IsImmediate, Txn, Message) ->
%% check_delivery(Mandatory, Immediate, {WasRouted, QPids})
check_delivery(true, _ , {false, []}) -> {error, unroutable};
-check_delivery(_ , true, {_ , []}) -> {error, not_delivered};
+check_delivery(_ , true, {_ , []}) -> {error, no_consumers};
check_delivery(_ , _ , {_ , Qs}) -> {ok, Qs}.