Closed the01 closed 7 years ago
Thanks for the Pull Request!
Did you test this? What kind of information did you gain? According to the WebSocket spec, the try-catch-block should never be invocated at all if the address is syntactically correct and there is no security exception: https://www.w3.org/TR/websockets/#the-websocket-interface Also, websocket.onerror will only ever receive a simple event without an descriptive message: https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_client_applications#Connection_errors
Actually, I was testing and having problems, but could not figure out why. And you are right, it was the onclose that gave me more information. Turns out, I was supplying invalid tokens to the server (because of time drift) and in response it just terminates the tcp connection. Since that is not a clean websocket shutdown, the onclose gets called with a CloseEvent.code of 1006.
Logs the error supplied to
CALLGLOBALHANDLER
(e.g.websocket.onerror
)