Skip to content

Commit 85ec8e0

Browse files
committed
Fix dialyzer errors
1 parent d8ca61c commit 85ec8e0

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

deps/rabbitmq_peer_discovery_etcd/src/rabbitmq_peer_discovery_etcd_v3_client.erl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,12 @@ connected({call, From}, {unlock, GeneratedKey}, Data = #statem_data{connection_n
213213
connected({call, From}, register, Data = #statem_data{connection_name = Conn}) ->
214214
Ctx = registration_context(Conn, Data),
215215
Key = node_key(Data),
216-
eetcd_kv:put(Ctx, Key, registration_value(Data)),
217-
rabbit_log:debug("etcd peer discovery: put key ~tp, done with registration", [Key]),
216+
case eetcd_kv:put(Ctx, Key, registration_value(Data)) of
217+
{ok, _} ->
218+
rabbit_log:debug("etcd peer discovery: put key ~tp, done with registration", [Key]);
219+
{error, Reason} ->
220+
rabbit_log:error("etcd peer discovery: put key ~tp failed: ~p", [Key, Reason])
221+
end,
218222
gen_statem:reply(From, ok),
219223
keep_state_and_data;
220224
connected({call, From}, unregister, Data = #statem_data{connection_name = Conn}) ->
@@ -379,9 +383,9 @@ disconnect(ConnName, #statem_data{connection_monitor = Ref}) ->
379383
unregister(Conn, Data = #statem_data{node_key_lease_id = LeaseID, node_lease_keepalive_pid = KAPid}) ->
380384
Ctx = unregistration_context(Conn, Data),
381385
Key = node_key(Data),
382-
eetcd_kv:delete(Ctx, Key),
386+
_ = eetcd_kv:delete(Ctx, Key),
383387
rabbit_log:debug("etcd peer discovery: deleted key ~ts, done with unregistration", [Key]),
384-
eetcd_lease:revoke(Ctx, LeaseID),
388+
_ = eetcd_lease:revoke(Ctx, LeaseID),
385389
exit(KAPid, normal),
386390
rabbit_log:debug("etcd peer discovery: revoked a lease ~tp for node key ~ts", [LeaseID, Key]),
387391
ok.

0 commit comments

Comments
 (0)