You are correct. Ask yourself this question: Why try … catch should catch asynchronous event? Do you expect this to catch also?
Process.exit(self(), :timeout)
try
:timer.sleep(1000)
catch
:exit, :timeout -> :ok
end
You can; you just need to do Process.flag(:trap_exit, true) and have a handle_info clause to handle the {:EXIT, pid, reason} message that you would receive.






















