def handle_call(msg, _from, state) do
proc =
case Process.info(self(), :registered_name) do
{_, []} -> self()
{_, name} -> name
end
# We do this to trick Dialyzer to not complain about non-local returns.
case :erlang.phash2(1, 1) do
0 ->
raise "attempted to call GenServer #{inspect(proc)} but no handle_call/3 clause was provided"
1 ->
{:stop, {:bad_call, msg}, state}
end
end
The :erlang.phash2(1, 1)
returns 0 every time I run the function in my iex. So, why not move the raise function out of the case block and remove the case block