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

Overzealous exception handling during handshake #56

Open
adrian-the-git opened this issue Jun 7, 2017 · 0 comments
Open

Overzealous exception handling during handshake #56

adrian-the-git opened this issue Jun 7, 2017 · 0 comments

Comments

@adrian-the-git
Copy link

When an exception occurs inside handleConnected, it's re-raised inside _handleData and then caught again inside the main serveForever loop.

The connection is then silently closed (no traceback is shown) so this can make it tricky to find the culprit of a misbehaved websocket. My sense would be to replace instances of raise Exception("Some websocketty thing") with raise WebSocketException("Some websocketty thing") so that they can be explicitly caught in the top-level select loop, and implementors of the WebSocket class will find their code crashing early and often 😬

I'd send a pull request, but I'm not sure I fully grok all the avenues of control flow wherein it would be advantageous to do something different, nor am I equipped to test it 😕

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

No branches or pull requests

1 participant