Skip to content

don't crash on socket error #141

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Juul
Copy link

@Juul Juul commented Mar 2, 2018

Don't crash, even if user does not specify a stream error handler.

@@ -83,6 +83,8 @@ function WebSocketStream(target, protocols, options) {
socket.onerror = onerror
socket.onmessage = onmessage

proxy.on('error', function(){})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignore errors? It can lead to even more long debugging then you have had.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems we have two options here: Ignore unhandled errors or have unhandled errors lead to crashes. My first pull request was to document how to handle errors so you don't have crashes and I was asked to instead fix the issue. I don't think there is a third option but I'd be very happy to learn something.

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

Successfully merging this pull request may close these issues.

2 participants