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

How would I handle an error when a client disconnects? #49

Open
nitroxplunge opened this issue Nov 4, 2017 · 1 comment
Open

How would I handle an error when a client disconnects? #49

nitroxplunge opened this issue Nov 4, 2017 · 1 comment

Comments

@nitroxplunge
Copy link

I have a node.js server that interfaces with a website, and when I close a tab the server crashes due to an "Unhandled 'error' event"

I assume I need to add an error handler after .listen() but I cant figure out how to do it.

I know this is a noob question but I'm still learning about websockets.

@ghost
Copy link

ghost commented Oct 23, 2018

conn.on("error", function (code, reason) {
console.log("error msg")
});

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