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

WebSocket#run doesn't catch errors other than EOF #3355

Closed
RX14 opened this issue Sep 26, 2016 · 3 comments
Closed

WebSocket#run doesn't catch errors other than EOF #3355

RX14 opened this issue Sep 26, 2016 · 3 comments

Comments

@RX14
Copy link
Member

RX14 commented Sep 26, 2016

WebSocket#run currently catches an IO::EOFError, and calls the on_close handler. Should this happen with other exceptions where the socket is closed, for example connection reset by peer?

@asterite
Copy link
Member

I'm not sure, I think we are missing an exception handler above that and an on_error or something like that. The websocket code is pretty young and misses a lot of things, probably also a way to use it without callbacks.

@RX14
Copy link
Member Author

RX14 commented Sep 26, 2016

Maybe on_close should only be called when the "close" message type is received. This keeps it's function specific and well-defined. Other errors should propagate up and be handled by the #run caller.

@straight-shoota
Copy link
Member

Resolved by #8975 et al

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

3 participants