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

fix: avoid clashing by ECONNRESET #25

Merged
merged 1 commit into from
Apr 20, 2018
Merged

fix: avoid clashing by ECONNRESET #25

merged 1 commit into from
Apr 20, 2018

Conversation

ktsn
Copy link
Owner

@ktsn ktsn commented Apr 20, 2018

fix #23

The problem caused by ECONNRESET error of WebSocket connection. When the user move to another tab and hide the preview tab, the preview page will be destroyed. Then the socket emit ECONNRESET error.

Looks like the WebSocket error will be automatically throws if we do not register any error event listener and it causes this problem. So I added an event listener that ignores only ECONNRESET error.

Note err.code is valid property of Node.js Error object. https://nodejs.org/api/errors.html#errors_error_code_1

@ktsn ktsn merged commit 1dd6dab into master Apr 20, 2018
@ktsn ktsn deleted the fix-econnreset branch April 20, 2018 15:15
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.

Reload preview page when coming back from other tab
1 participant