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

Error Handling for websocket #19

Closed
rndmania opened this issue Nov 12, 2015 · 7 comments
Closed

Error Handling for websocket #19

rndmania opened this issue Nov 12, 2015 · 7 comments

Comments

@rndmania
Copy link

express provide default error handler and also user add user-defined error handler
such as below form.
function errorHandler(err, req, res, next) {
}

but, if error is occurred during processing web socket req/res
this error can not handled by express error handler

so, i wondering that how to handle error for websocket?

@arik-so
Copy link

arik-so commented Apr 24, 2016

Wondering the same.

@HenningM
Copy link
Owner

Hi guys,

Thanks a lot for the feedback. I'm sorry that this library currently doesn't play nicely with the standard error handling in express. Fixing this shouldn't require too much effort, so I'll try to get it done before the end of this week.

@arik-so
Copy link

arik-so commented May 4, 2016

Thanks, @HenningM! Any updates? If not, do you have any pointers as to how to get it done? Alas, I have been unsuccessful with domains. But if you can recommend something, I could try to get a PR in.

@HenningM
Copy link
Owner

HenningM commented May 5, 2016

Hi again @arik-so,

Still haven't found time to implement a fix for this. I haven't dug into the details yet, but I have a feeling that this is related to how middlewares are wrapped here: https://github.com/HenningM/express-ws/blob/master/src/wrap-middleware.js#L1. PRs are always appreciated.

@ncalexan
Copy link

I appear to witness an immediate Error: socket hang up when I try to connect to a fresh server using express-ws. I haven't figured out if this is actually express-ws or something else. Will this ticket address catching that type of socket error? Or is there something else I can do right now? (I expected server.on('error', ...) to address this, but so far no luck.)

@kraenhansen
Copy link
Contributor

kraenhansen commented Jan 29, 2017

@HenningM I've created a very simple pull-request that will help moving this forward.

@HenningM
Copy link
Owner

The mentioned PR was released with version 3.0.0. Thanks a lot, @kraenhansen!

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

5 participants