Hello,
I have several dialyzer errors following the pattern below:
The pattern {'ok', _@3} can never match the type {'error',{'error','invalid_key' | 'no_ring'}}
The code snippet
def show(conn, remote_node_name) do
with {:ok, remote_node_atom} <- Util.to_existing_atom(remote_node_name),
{:ok, node_list} <- RiakNode.attrs(),
all_metrics = get_metrics(node_list) do
render(conn, "metrics.json", metrics: all_metrics)
else
{:error, _} ->
send_node_invalid(conn)
end
end
# Util.to_existing_atom is String.to_existing_atom which traps the Exception and converts it into {:error, :invalid_key}
# RiakNode.attrs :: {:ok, list} | {:error, :no_ring}
The dialyzer error doesn’t make sense since it should be trapped with {:error, _}
I tried expanding the errors into 2 separate clauses but that didn’t work either.