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

Websocket connection error cannot be caught by event handler #595

Open
1 of 2 tasks
Domiii opened this issue Jan 23, 2020 · 1 comment
Open
1 of 2 tasks

Websocket connection error cannot be caught by event handler #595

Domiii opened this issue Jan 23, 2020 · 1 comment

Comments

@Domiii
Copy link

Domiii commented Jan 23, 2020

You want to:

  • report a bug
  • request a feature

Problem Description

Connection fails silently, causing headaches and hours of time spent debugging.

I had a problem in my webpack build, causing connection to fail silently on Node, caused by this websocket issue (which in turn is caused by webpack's broken default build settings).

To be clear: This bug is not caused by engine.io, but it is accidentally silencing it.

Specifically, the problem is in websocket.doOpen's try/catch handler. It will emit the error, but since, the first time around, doOpen is called from the Manager.constructor, it would be impossible to register any event handler at that point, making this error always go unnoticed, no matter what you do.

Here is the callstack:

image

Steps to reproduce (if the current behaviour is a bug)

Anything that causes websocket.doOpen to fail (such as a default webpack build run on Node) will fail silently.

Discussion

Maybe there should be a default error handler that acts if none was registered? This would alsomake it easier for people to get started and reliably find any potential problem without having to debug the dependency?

As an alternative, I am also thinking, straight up throwing the error when it happens in the constructor (or in general, if no error handler is provided) would still be better than what it is right now?

@haneenmahd
Copy link

This issue doesn't seem to have an activity this issue and looks everything is working as expected.

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

2 participants