Skip to content

Commit f223845

Browse files
committed
Keep stream_* return codes
To keep compatibility with the Erlang client's users. References #5412
1 parent e587e9a commit f223845

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

deps/rabbitmq_stream/src/rabbit_stream_manager.erl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ lookup_member(VirtualHost, Stream) ->
111111
{ok,
112112
#{leader_node => undefined | pid(),
113113
replica_nodes => [pid()]}} |
114-
{error, not_found} | {error, not_available}.
114+
{error, stream_not_found} | {error, stream_not_available}.
115115
topology(VirtualHost, Stream) ->
116116
gen_server:call(?MODULE, {topology, VirtualHost, Stream}).
117117

@@ -396,6 +396,10 @@ handle_call({topology, VirtualHost, Stream}, _From, State) ->
396396
_ ->
397397
{error, not_available}
398398
end;
399+
{error, not_found} ->
400+
{error, stream_not_found};
401+
{error, not_available} ->
402+
{error, stream_not_available};
399403
R ->
400404
R
401405
end,

deps/rabbitmq_stream_common/src/rabbit_stream_core.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,9 +406,9 @@ response_body({metadata = Tag, Endpoints, Metadata}) ->
406406
maps:fold(fun (Stream, Info, Acc) when is_atom(Info) ->
407407
Code =
408408
case Info of
409-
not_found ->
409+
stream_not_found ->
410410
?RESPONSE_CODE_STREAM_DOES_NOT_EXIST;
411-
not_available ->
411+
stream_not_available ->
412412
?RESPONSE_CODE_STREAM_NOT_AVAILABLE
413413
end,
414414
StreamLength = byte_size(Stream),

0 commit comments

Comments
 (0)