Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling Errors #19

Open
elliotstokes opened this issue Aug 5, 2016 · 0 comments
Open

Handling Errors #19

elliotstokes opened this issue Aug 5, 2016 · 0 comments

Comments

@elliotstokes
Copy link

elliotstokes commented Aug 5, 2016

I have the following function to connect to a socket

initPhoenixSocket =
  Phoenix.Socket.init socketUrl
    |> Phoenix.Socket.withDebug
    |> Phoenix.Socket.on "something" socketName DoSomething
    |> Phoenix.Socket.on "somethingelse"  socketName DoSomethingElse

and I am also then listening to the socket in the subscription with

subscriptions : Model -> Sub Msg
subscriptions model =
  Phoenix.Socket.listen model.phxSocket PhoenixMsg

Looking through the documentation and the example code I cant see the best way to handle when the socket cannot successfully init (when the server is down etc.)

Looking through the source, it looks like there are a few functions that might help:

onError and onJoinError with the channel but I cant see anything on the initial socket. It looks like the websocket library exposes an error but I cant see a place to hook into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants