Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.

Error when websocket connection fails could be clearer #4

@darkvertex

Description

@darkvertex

Hi! Nice extension. Finally got it working after I realised the player had failed to start up the websocket server, even though it was working and capable of playing music otherwise. (I debugged this by attempting to connect to ws://localhost:5672 with https://github.com/lafikl/telsocket)

While the websocket didn't work I was greeted with "Failure to run command" errors for any actions, presenting this nice error dump in one of the Output terminals:

[2018-06-27 18:26:49.705] [exthost1] [error] Error: not opened
    at WebSocket.send (/mnt/users/alan/.vscode/extensions/nbdeg.vscode-gmusic-1.2.0/node_modules/ws/lib/WebSocket.js:344:18)
    at gMusicClass.togglePlay (/mnt/users/alan/.vscode/extensions/nbdeg.vscode-gmusic-1.2.0/out/extension.js:122:17)
    at vscode_1.commands.registerCommand (/mnt/users/alan/.vscode/extensions/nbdeg.vscode-gmusic-1.2.0/out/extension.js:8:16)
    at e._executeContributedCommand (/usr/share/code/resources/app/out/vs/workbench/node/extensionHostProcess.js:674:613)
    at e.$executeContributedCommand (/usr/share/code/resources/app/out/vs/workbench/node/extensionHostProcess.js:675:6)
    at e._doInvokeHandler (/usr/share/code/resources/app/out/vs/workbench/node/extensionHostProcess.js:636:832)
    at e._invokeHandler (/usr/share/code/resources/app/out/vs/workbench/node/extensionHostProcess.js:636:550)
    at e._receiveRequest (/usr/share/code/resources/app/out/vs/workbench/node/extensionHostProcess.js:635:631)
    at e._receiveOneMessage (/usr/share/code/resources/app/out/vs/workbench/node/extensionHostProcess.js:635:400)
    at /usr/share/code/resources/app/out/vs/workbench/node/extensionHostProcess.js:634:315
    at /usr/share/code/resources/app/out/vs/workbench/node/extensionHostProcess.js:637:395
    at /usr/share/code/resources/app/out/vs/workbench/node/extensionHostProcess.js:95:432
    at e.fire (/usr/share/code/resources/app/out/vs/workbench/node/extensionHostProcess.js:96:764)
    at Socket.<anonymous> (/usr/share/code/resources/app/out/vs/workbench/node/extensionHostProcess.js:154:338)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:191:7)
    at readableAddChunk (_stream_readable.js:178:18)
    at Socket.Readable.push (_stream_readable.js:136:10)
    at Pipe.onread (net.js:560:20) gmusic.playpause

Could be nice to consider presenting a friendly error notification saying something like "Websocket failed to connect. Check the player is running and the JSON API is enabled." or something like that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions