def handle_disconnect(conn_status_map, state) do
IO.inspect conn_status_map
{:ok, state}
end
def terminate(reason, _state) do
exit(:normal)
end
So when reason inside conn_map_status is {:remote, :closed}, it terminates perfectly.
But how can i make it work when reason is %WebSockex.ConnError{original: :econnrefused} ?
%WebSockex.ConnError{original: :econnrefused} is an error that occurs trying to negotiate the connection. I don't think it would ever trigger a disconnect event because there's no connection in the first place.
Hello! That's how looks like my code:
So when
reason
insideconn_map_status
is{:remote, :closed}
, it terminates perfectly. But how can i make it work whenreason
is%WebSockex.ConnError{original: :econnrefused}
?