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 #84

Closed
hakonrossebo opened this issue Jun 20, 2017 · 3 comments
Closed

Websocket connection error #84

hakonrossebo opened this issue Jun 20, 2017 · 3 comments

Comments

@hakonrossebo
Copy link

hakonrossebo commented Jun 20, 2017

While testing vscode-elm websocket against elm-analyse, I get this exception/stack trace when saving files (after initial ws connection). I have only observed this on Windows so far (Much faster on Linux). At the same time it also seems to restart the socket connection (I have a message showing up on the "open" event).
This could possibly be related to my ws implementation.


C:\Users\username\AppData\Roaming\npm\node_modules\elm-analyse\node_modules\ws\lib\WebSocket.js:219
    else throw new Error('not opened');
         ^

Error: not opened
    at WebSocket.send (C:\Users\username\AppData\Roaming\npm\node_modules\elm-analyse\node_modules\ws\lib\WebSocket.js:219:16)
    at expressWs.getWss.clients.forEach.x (C:\Users\username\AppData\Roaming\npm\node_modules\elm-analyse\js\server\dashboard.js:22:51)
    at Array.forEach (native)
    at Array.<anonymous> (C:\Users\username\AppData\Roaming\npm\node_modules\elm-analyse\js\server\dashboard.js:22:36)
    at Function.onEffects [as func] (C:\Users\username\AppData\Roaming\npm\node_modules\elm-analyse\js\backend-elm.js:2706:19)
    at A3 (C:\Users\username\AppData\Roaming\npm\node_modules\elm-analyse\js\backend-elm.js:98:11)
    at onMessage (C:\Users\username\AppData\Roaming\npm\node_modules\elm-analyse\js\backend-elm.js:2489:12)
    at Object.callback (C:\Users\username\AppData\Roaming\npm\node_modules\elm-analyse\js\backend-elm.js:2531:11)
    at step (C:\Users\username\AppData\Roaming\npm\node_modules\elm-analyse\js\backend-elm.js:3068:32)
    at Timeout.work [as _onTimeout] (C:\Users\username\AppData\Roaming\npm\node_modules\elm-analyse\js\backend-elm.js:3110:15)
@stil4m
Copy link
Owner

stil4m commented Jun 20, 2017

It seems that the server wants to send something on a socket which is in a invalid state. This is an elm-analyse issue and should gracefully handled.

Can you investigate why the connection is closed?

@hakonrossebo
Copy link
Author

Fixed this issue on the client side - had some event starting the websocket multiple times. Ok to close issue.

@stil4m stil4m added this to the 0.10.0 milestone Jun 21, 2017
@stil4m
Copy link
Owner

stil4m commented Jun 21, 2017

I'll leave it open because the server should handle it gracefully. The fix will be an easy try catch with some logging.

stil4m added a commit that referenced this issue Jun 21, 2017
Issue #84: Catch errors on ws and log warning
@stil4m stil4m closed this as completed Jun 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants