Skip to content

Conversation

@sargonpiraev
Copy link

I have discovered that in some cases error object has no message property. For example when target url is invalid and error code is 1006. I found here https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_client_applications#Connection_errors

If an error occurs while attempting to connect, first a simple event with the name "error" is sent to the WebSocket object (thereby invoking its onerror handler), and then the CloseEvent is sent to the WebSocket

http://stackoverflow.com/questions/19304157/getting-the-reason-why-websockets-closed - here is explanation what 1006 mean.

So when error.message is undefined we get error argument in connect callback as undefined too. this is incorrect because we cant know if this error happened.

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.

1 participant