While Elixir encourages us not to use try/catch blocks there are times when they are needed. In an application I wrote I have the following try/catch which works.
try do
message = GenServer.call(via, :get_messages)
{:ok, message}
catch
:exit, _ -> {:error, "Process uuid no longer exists"}
end
In the catch section I changed :exit, - to {:exit, _} thinking that they were the same thing and that resulted in breaking the code.
My question is what is :exit, _
It does not seam to be a tuple, list, etc. Even when I used _ it did not match. Is catch a macro that expects parameters?